]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Look for uuencoded test files in the directory containing this module, too.
authorGuido van Rossum <guido@python.org>
Sun, 7 Sep 1997 16:54:34 +0000 (16:54 +0000)
committerGuido van Rossum <guido@python.org>
Sun, 7 Sep 1997 16:54:34 +0000 (16:54 +0000)
(This is necessary because when imported as test.test_rgbimg, the test
directory is not on sys.path.)

Lib/test/test_rgbimg.py

index 3bc206f08c9accda5e5e444616e7d89f33f4e332..c5b7c83b005a88d6df2f4fcf31e8db201acd7269 100644 (file)
@@ -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