INNER CODE UNIT · Python
_run_module
enarjord/passivbot · src/passivbot_cli/main.py:513
def _run_module(
module_name: str, prog_name: str, argv: list[str], requires_full: bool = False
) -> int:
if requires_full and not _is_help_request(argv):
if _missing_full_install_markers():
print(_full_install_message(prog_name), file=sys.stderr)
return 2
previous_argv = sys.argv[:]
previous_prog = os.environ.get("PASSIVBOT_CLI_PROG")
sys.argv = [prog_name, *argv]
os.environ["PASSIVBOT_CLI_PROG"] = prog_name
try:
ran_main, exit_code = _invoke_module_main(module_name)
if ran_main:
return exit_code
runpy.run_module(module_name, run_name="__main__")
except ModuleNotFoundError as exc: