Kaydet (Commit) 077c5823 authored tarafından Just van Rossum's avatar Just van Rossum

always also search on sys.path for res files

üst 698258a1
...@@ -49,9 +49,8 @@ def need(restype, resid, filename=None, modname=None): ...@@ -49,9 +49,8 @@ def need(restype, resid, filename=None, modname=None):
if sys.modules.has_key(modname): if sys.modules.has_key(modname):
mod = sys.modules[modname] mod = sys.modules[modname]
if hasattr(mod, '__file__'): if hasattr(mod, '__file__'):
searchdirs = [os.path.split(mod.__file__)[0]] searchdirs = [os.path.dirname(mod.__file__)]
if not searchdirs: searchdirs.extend(sys.path)
searchdirs = sys.path
# And look for the file # And look for the file
for dir in searchdirs: for dir in searchdirs:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment