mirror of
https://github.com/sotam0316/docker-py-revanced.git
synced 2026-04-25 03:48:37 +09:00
🎨 Use newer style of coding (#287)
This commit is contained in:
+5
-5
@@ -1,4 +1,6 @@
|
||||
"""Revanced Patches."""
|
||||
|
||||
import contextlib
|
||||
import json
|
||||
from typing import Any, Dict, List, Tuple
|
||||
|
||||
@@ -114,10 +116,8 @@ class Patches(object):
|
||||
raise AppNotFound(app)
|
||||
patches = getattr(self, app_name)
|
||||
version = "latest"
|
||||
try:
|
||||
with contextlib.suppress(StopIteration):
|
||||
version = next(i["version"] for i in patches if i["version"] != "all")
|
||||
except StopIteration:
|
||||
pass
|
||||
return patches, version
|
||||
|
||||
def include_exclude_patch(
|
||||
@@ -174,5 +174,5 @@ class PatchLoader:
|
||||
with open(file_name) as f:
|
||||
patches = json.load(f)
|
||||
return patches
|
||||
except FileNotFoundError:
|
||||
raise PatchesJsonFailed()
|
||||
except FileNotFoundError as e:
|
||||
raise PatchesJsonFailed() from e
|
||||
|
||||
Reference in New Issue
Block a user