From 1b0803e40a8c03c08ed5ced1e72d31f147f87ef0 Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Tue, 14 Dec 2021 08:39:46 +0000 Subject: [PATCH] Avoid exception with tox.ini containing allowlist_externals Fixes: #45 --- src/tox_current_env/hooks.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tox_current_env/hooks.py b/src/tox_current_env/hooks.py index 80de07d..4552b38 100644 --- a/src/tox_current_env/hooks.py +++ b/src/tox_current_env/hooks.py @@ -72,7 +72,9 @@ def tox_configure(config): if _plugin_active(config.option): config.skipsdist = True for testenv in config.envconfigs: - config.envconfigs[testenv].whitelist_externals = "*" + for entry in ['allowlist_externals', 'whitelist_externals']: + if getattr(config.envconfigs[testenv], entry, None): + setattr(config.envconfigs[testenv], entry, "*") config.envconfigs[testenv].usedevelop = False if (getattr(config.option.print_deps_to, "name", object()) ==