diff --git a/worlds/Files.py b/worlds/Files.py
index 69a88218efd4..c71257d62d7b 100644
--- a/worlds/Files.py
+++ b/worlds/Files.py
@@ -14,7 +14,6 @@
 semaphore = threading.Semaphore(os.cpu_count() or 4)
 
 del threading
-del os
 
 
 class AutoPatchRegister(abc.ABCMeta):
@@ -33,6 +32,9 @@ def __new__(mcs, name: str, bases: Tuple[type, ...], dct: Dict[str, Any]) -> Aut
 
     @staticmethod
     def get_handler(file: str) -> Optional[AutoPatchRegister]:
+        _, suffix = os.path.splitext(file)
+        if suffix in AutoPatchRegister.file_endings:
+            return AutoPatchRegister.file_endings[suffix]
         for file_ending, handler in AutoPatchRegister.file_endings.items():
             if file.endswith(file_ending):
                 return handler