Core: load frozen decompressed worlds (#3488)

This commit is contained in:
Fabian Dill 2024-06-08 19:58:58 +02:00 committed by GitHub
parent 302017c69e
commit 0d9fce29c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -107,8 +107,9 @@ for folder in (folder for folder in (user_folder, local_folder) if folder):
if not entry.name.startswith(("_", ".")):
file_name = entry.name if relative else os.path.join(folder, entry.name)
if entry.is_dir():
init_file_path = os.path.join(entry.path, '__init__.py')
if os.path.isfile(init_file_path):
if os.path.isfile(os.path.join(entry.path, '__init__.py')):
world_sources.append(WorldSource(file_name, relative=relative))
elif os.path.isfile(os.path.join(entry.path, '__init__.pyc')):
world_sources.append(WorldSource(file_name, relative=relative))
else:
logging.warning(f"excluding {entry.name} from world sources because it has no __init__.py")