mirror of https://github.com/python/cpython
We should look in the directory containing the module, not in the module itself, when we're looking for the resource file.
This commit is contained in:
parent
eb9f384c28
commit
b214c36d0a
|
@ -49,7 +49,7 @@ def need(restype, resid, filename=None, modname=None):
|
|||
if sys.modules.has_key(modname):
|
||||
mod = sys.modules[modname]
|
||||
if hasattr(mod, '__file__'):
|
||||
searchdirs = [mod.__file__]
|
||||
searchdirs = [os.path.split(mod.__file__)[0]]
|
||||
if not searchdirs:
|
||||
searchdirs = sys.path
|
||||
|
||||
|
|
Loading…
Reference in New Issue