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

Skip to content

Commit f1b0009

Browse files
committed
Fix path search for test data file so it works under more circumstances.
1 parent 88d8bee commit f1b0009

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

Lib/test/test_imageop.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,12 @@ def get_qualified_path(name):
155155
""" return a more qualified path to name"""
156156
import sys
157157
import os
158-
for dir in sys.path:
158+
path = sys.path
159+
try:
160+
path = [os.path.dirname(__file__)] + path
161+
except NameError:
162+
pass
163+
for dir in path:
159164
fullname = os.path.join(dir, name)
160165
if os.path.exists(fullname):
161166
return fullname

0 commit comments

Comments
 (0)