Core: use patch extension register directly (#4375)

Co-authored-by: Aaron Wagener <[email protected]>
This commit is contained in:
qwint
2025-07-26 22:13:15 +02:00
committed by GitHub
co-authored by Aaron Wagener
parent faac2540bf
commit fa49fef695
+2 -5
View File
@@ -15,7 +15,6 @@ import bsdiff4
semaphore = threading.Semaphore(os.cpu_count() or 4)
del threading
del os
class AutoPatchRegister(abc.ABCMeta):
@@ -34,10 +33,8 @@ class AutoPatchRegister(abc.ABCMeta):
@staticmethod
def get_handler(file: str) -> Optional[AutoPatchRegister]:
for file_ending, handler in AutoPatchRegister.file_endings.items():
if file.endswith(file_ending):
return handler
return None
_, suffix = os.path.splitext(file)
return AutoPatchRegister.file_endings.get(suffix, None)
class AutoPatchExtensionRegister(abc.ABCMeta):