Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b214c36

Browse files
committed
We should look in the directory containing the module, not in the module itself, when we're looking for the resource file.
1 parent eb9f384 commit b214c36

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Mac/Lib/macresource.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def need(restype, resid, filename=None, modname=None):
4949
if sys.modules.has_key(modname):
5050
mod = sys.modules[modname]
5151
if hasattr(mod, '__file__'):
52-
searchdirs = [mod.__file__]
52+
searchdirs = [os.path.split(mod.__file__)[0]]
5353
if not searchdirs:
5454
searchdirs = sys.path
5555

0 commit comments

Comments
 (0)