Fix import of compiled module with python3.

This at least fix #331
This commit is contained in:
ColinDuquesnoy
2014-02-17 09:08:30 +01:00
parent 2f3e4152b4
commit a75773cf9f

View File

@@ -33,9 +33,15 @@ def find_module_py33(string, path=None):
module_path = loader.get_filename(string)
module_file = open(module_path)
except AttributeError:
# is builtin module
# ExtensionLoader has not attribute get_filename, instead it has a
# path attribute that we can use to retrieve the module path
try:
module_path = loader.path
module_file = open(loader.path, 'rb')
except AttributeError:
module_path = string
module_file = None
finally:
is_package = False
return module_file, module_path, is_package