From 7fdc3e2619a02471f705f6f29252670ebeef9ef9 Mon Sep 17 00:00:00 2001 From: aitbc Date: Tue, 26 May 2026 11:26:18 +0200 Subject: [PATCH] fix: register CLI module in sys.modules for proper package resolution - Added sys.modules["aitbc_cli.core.main"] registration before exec_module - Fixes ModuleNotFoundError for aitbc_cli.utils.dual_mode_wallet_adapter - Ensures subpackage imports resolve correctly when loaded via spec_from_file_location - Allows wallet commands to import from aitbc_cli.utils properly --- cli/aitbc_cli.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cli/aitbc_cli.py b/cli/aitbc_cli.py index 09b33afd..8cac413a 100755 --- a/cli/aitbc_cli.py +++ b/cli/aitbc_cli.py @@ -35,6 +35,8 @@ def _load_cli_module() -> ModuleType: raise ImportError(f"Unable to load modular CLI entrypoint from {cli_path}") module = importlib.util.module_from_spec(spec) + # Register module in sys.modules with proper package name for import resolution + sys.modules["aitbc_cli.core.main"] = module spec.loader.exec_module(module) _CLI_MODULE = module return module