diff --git a/worlds/yugioh06/Client_bh.py b/worlds/yugioh06/Client_bh.py index 4f4bb6690977..ecde2a53ec88 100644 --- a/worlds/yugioh06/Client_bh.py +++ b/worlds/yugioh06/Client_bh.py @@ -5,25 +5,6 @@ from worlds.yugioh06 import item_to_index -# This imports the bizhawk apworld if it's not already imported. This code block should be removed for a PR. -if "worlds._bizhawk" not in sys.modules: - import importlib - import os - import zipimport - - bh_apworld_path = os.path.join(os.path.dirname(sys.modules["worlds"].__file__), "_bizhawk.apworld") - if os.path.isfile(bh_apworld_path): - importer = zipimport.zipimporter(bh_apworld_path) - spec = importer.find_spec(os.path.basename(bh_apworld_path).rsplit(".", 1)[0]) - mod = importlib.util.module_from_spec(spec) - mod.__package__ = f"worlds.{mod.__package__}" - mod.__name__ = f"worlds.{mod.__name__}" - sys.modules[mod.__name__] = mod - importer.exec_module(mod) - elif not os.path.isdir(os.path.splitext(bh_apworld_path)[0]): - raise AssertionError("Did not find _bizhawk.apworld required to play Yu-Gi-Oh! 2006.") - - from NetUtils import ClientStatus, NetworkItem import worlds._bizhawk as bizhawk from worlds._bizhawk.client import BizHawkClient diff --git a/worlds/yugioh06/__init__.py b/worlds/yugioh06/__init__.py index 1ba0c6cd2aa5..dbe14b71a48b 100644 --- a/worlds/yugioh06/__init__.py +++ b/worlds/yugioh06/__init__.py @@ -31,6 +31,8 @@ logging.warning("Did not find _bizhawk.apworld required to play Yu-Gi-Oh! 2006. Still able to generate.") else: from .Client_bh import YuGiOh2006Client # Unused, but required to register with BizHawkClient +else: + from .Client_bh import YuGiOh2006Client # Unused, but required to register with BizHawkClient class Yugioh06Web(WebWorld):