mirror of
https://github.com/sotam0316/docker-py-revanced.git
synced 2026-04-25 11:58:37 +09:00
🎨 Try to open file instead of checking
This commit is contained in:
+2
-2
@@ -1,6 +1,5 @@
|
|||||||
"""Revanced Patches."""
|
"""Revanced Patches."""
|
||||||
import json
|
import json
|
||||||
import os
|
|
||||||
from typing import Any, Dict, List, Tuple
|
from typing import Any, Dict, List, Tuple
|
||||||
|
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
@@ -66,10 +65,11 @@ class Patches(object):
|
|||||||
|
|
||||||
def scrap_patches(self, file_name: str) -> Any:
|
def scrap_patches(self, file_name: str) -> Any:
|
||||||
"""Scrap Patches."""
|
"""Scrap Patches."""
|
||||||
if os.path.exists(file_name):
|
try:
|
||||||
with open(file_name) as f:
|
with open(file_name) as f:
|
||||||
patches = json.load(f)
|
patches = json.load(f)
|
||||||
return patches
|
return patches
|
||||||
|
except FileNotFoundError:
|
||||||
raise PatchesJsonFailed()
|
raise PatchesJsonFailed()
|
||||||
|
|
||||||
# noinspection DuplicatedCode
|
# noinspection DuplicatedCode
|
||||||
|
|||||||
Reference in New Issue
Block a user