From cae34382a47ecb7c15087b0e9ff41a2bf05ce81d Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 29 Jan 2021 16:51:20 +0100 Subject: [PATCH] have to delete all pype modules from sys.modules --- start.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/start.py b/start.py index ad863481ff..5618920164 100644 --- a/start.py +++ b/start.py @@ -508,9 +508,13 @@ def boot(): os.environ["PYPE_ROOT"], "repos") # delete Pype module from cache so it is used from specific version + modules_to_del = [] + for module_name in sys.modules: + if module_name == "pype" or module_name.startswith("pype."): + modules_to_del.append(module_name) try: - del sys.modules["pype"] - del sys.modules["pype.version"] + for module_name in modules_to_del: + del sys.modules[module_name] except AttributeError: pass except KeyError: