mirror of
https://gitlab.com/ita1024/waf.git
synced 2024-11-23 02:16:01 +01:00
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)
|
module_dir = os.path.dirname(path)
|
||||||
sys.path.insert(0, module_dir)
|
sys.path.insert(0, module_dir)
|
||||||
|
|
||||||
exec(compile(code, path, 'exec'), module.__dict__)
|
try : exec(compile(code, path, 'exec'), module.__dict__)
|
||||||
sys.path.remove(module_dir)
|
finally: sys.path.remove(module_dir)
|
||||||
|
|
||||||
cache_modules[path] = module
|
cache_modules[path] = module
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user