mirror of https://gitlab.com/ita1024/waf.git
Ensure restoration of sys.path in Context.load_module()
This commit is contained in:
parent
b22118a2de
commit
64f557a17e
|
@ -621,8 +621,8 @@ def load_module(path, encoding=None):
|
|||
module_dir = os.path.dirname(path)
|
||||
sys.path.insert(0, module_dir)
|
||||
|
||||
exec(compile(code, path, 'exec'), module.__dict__)
|
||||
sys.path.remove(module_dir)
|
||||
try : exec(compile(code, path, 'exec'), module.__dict__)
|
||||
finally: sys.path.remove(module_dir)
|
||||
|
||||
cache_modules[path] = module
|
||||
|
||||
|
|
Loading…
Reference in New Issue