Debugging tainted namespace on profile modules.

This commit is contained in:
Anton Hvornum 2021-03-21 14:51:59 +01:00
parent c1e8e6b58d
commit ec9059c039
No known key found for this signature in database
GPG Key ID: F1234C5BA67C59DF
1 changed files with 1 additions and 5 deletions

View File

@ -129,15 +129,11 @@ class Script():
if not namespace:
namespace = self.namespace
if namespace in sys.modules:
print(f"Found {self} in sys.modules, returning cached import.")
return self
self.spec = importlib.util.spec_from_file_location(namespace, self.path)
imported = importlib.util.module_from_spec(self.spec)
sys.modules[namespace] = imported
print(f"Imported {self} into sys.modules. Returning fresh copy.")
print(f"Imported {self} into sys.modules with namespace {namespace}.")
return self
def execute(self):