From f1b0009a7807e18fad3e2e17c8cb3b4a4eb20b07 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Wed, 1 Oct 1997 22:10:32 +0000 Subject: [PATCH] Fix path search for test data file so it works under more circumstances. --- Lib/test/test_imageop.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_imageop.py b/Lib/test/test_imageop.py index 77281ab52b2..89b111cf2ba 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