diff --git a/Lib/test/test_rgbimg.py b/Lib/test/test_rgbimg.py index 3bc206f08c9..c5b7c83b005 100644 --- a/Lib/test/test_rgbimg.py +++ b/Lib/test/test_rgbimg.py @@ -11,8 +11,12 @@ print 'RGBimg test suite:' def findfile(file): if os.path.isabs(file): return file import sys - print "__file__ =", __file__ - for dn in [os.path.dirname(__file__)] + sys.path: + path = sys.path + try: + path = [os.path.dirname(__file__)] + path + except NameError: + pass + for dn in path: fn = os.path.join(dn, file) if os.path.exists(fn): return fn return file