]> granicus.if.org Git - python/commitdiff
Fix path search for test data file so it works under more circumstances.
authorGuido van Rossum <guido@python.org>
Wed, 1 Oct 1997 22:10:32 +0000 (22:10 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 1 Oct 1997 22:10:32 +0000 (22:10 +0000)
Lib/test/test_imageop.py

index 77281ab52b246b63858f2427cf1f76dbcfdcdbc2..89b111cf2ba0e259ea933a071bde5c52e3a6a33f 100755 (executable)
@@ -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