Debugging tainted namespace on profile modules.

This commit is contained in:
Anton Hvornum 2021-03-21 14:19:39 +01:00
parent df1ed2034d
commit b81d5e054d
No known key found for this signature in database
GPG Key ID: F1234C5BA67C59DF
1 changed files with 3 additions and 0 deletions

View File

@ -129,6 +129,9 @@ class Script():
if namespace:
self.namespace = namespace
if '.py' in self.namespace:
raise KeyError("Debugging")
self.spec = importlib.util.spec_from_file_location(self.namespace, self.path)
imported = importlib.util.module_from_spec(self.spec)
sys.modules[self.namespace] = imported