Fix handling of empty path '' in load_module

This commit is contained in:
Jason Paryani
2013-09-03 01:03:29 -07:00
parent 83e30f5a30
commit 80d2e59c08

View File

@@ -1251,7 +1251,8 @@ class _Loader:
"invalid module, expected %s, got %s" % ( "invalid module, expected %s, got %s" % (
self.fullname, fullname)) self.fullname, fullname))
imports = self.additional_paths + _sys.path # TODO: change '' to '.' in sys.path imports = self.additional_paths + _sys.path
imports = [path if path != '' else '.' for path in imports] # convert empty path '' to '.'
module = load(self.path, fullname, imports=imports) module = load(self.path, fullname, imports=imports)
_sys.modules[fullname] = module _sys.modules[fullname] = module