mirror of
https://github.com/python/cpython.git
synced 2025-10-21 22:22:48 +00:00
always also search on sys.path for res files
This commit is contained in:
parent
698258a199
commit
077c5823d1
1 changed files with 2 additions and 3 deletions
|
@ -49,9 +49,8 @@ def need(restype, resid, filename=None, modname=None):
|
|||
if sys.modules.has_key(modname):
|
||||
mod = sys.modules[modname]
|
||||
if hasattr(mod, '__file__'):
|
||||
searchdirs = [os.path.split(mod.__file__)[0]]
|
||||
if not searchdirs:
|
||||
searchdirs = sys.path
|
||||
searchdirs = [os.path.dirname(mod.__file__)]
|
||||
searchdirs.extend(sys.path)
|
||||
|
||||
# And look for the file
|
||||
for dir in searchdirs:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue