Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core: use patch extension register directly #4375

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion worlds/Files.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
semaphore = threading.Semaphore(os.cpu_count() or 4)

del threading
del os


class AutoPatchRegister(abc.ABCMeta):
Expand All @@ -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
Expand Down
Loading