Set __file__ of bytecode imports

This commit is contained in:
Kodi Arfer 2017-04-15 15:50:26 -07:00
parent 401a5e109c
commit ec0902b649

View File

@ -136,9 +136,9 @@ def import_file_to_module(module_name, fpath, loader=None):
sys.modules.pop(module_name, None) sys.modules.pop(module_name, None)
raise raise
sys.modules[module_name] = module sys.modules[module_name] = module
module.__file__ = fpath
module.__name__ = module_name module.__name__ = module_name
module.__file__ = fpath
if loader: if loader:
module.__loader__ = loader module.__loader__ = loader
if is_package(module_name): if is_package(module_name):