diff --git a/src/tox_current_env/hooks4.py b/src/tox_current_env/hooks4.py index 8c78637..c11e90e 100644 --- a/src/tox_current_env/hooks4.py +++ b/src/tox_current_env/hooks4.py @@ -79,8 +79,13 @@ def tox_add_core_config(core_conf, config): def tox_add_env_config(env_conf, config): # This allows all external commands. # All of them are extenal for us. - loader = MemoryLoader(allowlist_externals=["*"]) - config.core.loaders.insert(0, loader) + allow_external_cmds = MemoryLoader(allowlist_externals=["*"]) + config.core.loaders.insert(0, allow_external_cmds) + # For print-deps-to and print-extras-to, use empty + # list of commands. + if config.options.print_deps_to or config.options.print_extras_to: + empty_commands = MemoryLoader(commands=[]) + env_conf.loaders.insert(0, empty_commands) class CurrentEnv(PythonRun): @@ -192,9 +197,6 @@ class PrintEnv(CurrentEnv): ) self.options.print_extras_to.flush() - # We are done - sys.exit(0) - @staticmethod def id(): return "print-env"