From fa49fef6958f04557f5f7c55ba5ab4f8b3511a59 Mon Sep 17 00:00:00 2001 From: qwint Date: Sat, 26 Jul 2025 15:13:15 -0500 Subject: [PATCH] Core: use patch extension register directly (#4375) Co-authored-by: Aaron Wagener --- worlds/Files.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/worlds/Files.py b/worlds/Files.py index fa3739a5..27c0e9c4 100644 --- a/worlds/Files.py +++ b/worlds/Files.py @@ -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):