summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_imageop.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-10-01 22:10:32 (GMT)
committerGuido van Rossum <guido@python.org>1997-10-01 22:10:32 (GMT)
commitf1b0009a7807e18fad3e2e17c8cb3b4a4eb20b07 (patch)
tree757d9d09a549642a53cfa8345da1c090723924a5 /Lib/test/test_imageop.py
parent88d8beec0a1196fd33332fe18e893dae796dc505 (diff)
downloadcpython-f1b0009a7807e18fad3e2e17c8cb3b4a4eb20b07.zip
cpython-f1b0009a7807e18fad3e2e17c8cb3b4a4eb20b07.tar.gz
cpython-f1b0009a7807e18fad3e2e17c8cb3b4a4eb20b07.tar.bz2
Fix path search for test data file so it works under more circumstances.
Diffstat (limited to 'Lib/test/test_imageop.py')
-rwxr-xr-xLib/test/test_imageop.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/test/test_imageop.py b/Lib/test/test_imageop.py
index 77281ab..89b111c 100755
--- a/Lib/test/test_imageop.py
+++ b/Lib/test/test_imageop.py
@@ -155,7 +155,12 @@ def get_qualified_path(name):
""" return a more qualified path to name"""
import sys
import os
- for dir in sys.path:
+ path = sys.path
+ try:
+ path = [os.path.dirname(__file__)] + path
+ except NameError:
+ pass
+ for dir in path:
fullname = os.path.join(dir, name)
if os.path.exists(fullname):
return fullname