diff options
author | Guido van Rossum <guido@python.org> | 1997-05-22 20:48:03 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-05-22 20:48:03 (GMT) |
commit | f1e63545483a3b4eb7d8357e8a1ed2cb048bbb00 (patch) | |
tree | bb0a99e2f85607bec83bca986256c54cd3f05505 /Lib/dos_8x3/test_ima.py | |
parent | c2d14176153038d568770f5499c8aa6a8c6a93fc (diff) | |
download | cpython-f1e63545483a3b4eb7d8357e8a1ed2cb048bbb00.zip cpython-f1e63545483a3b4eb7d8357e8a1ed2cb048bbb00.tar.gz cpython-f1e63545483a3b4eb7d8357e8a1ed2cb048bbb00.tar.bz2 |
The usual
Diffstat (limited to 'Lib/dos_8x3/test_ima.py')
-rw-r--r-- | Lib/dos_8x3/test_ima.py | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/Lib/dos_8x3/test_ima.py b/Lib/dos_8x3/test_ima.py index f9108ef..77281ab 100644 --- a/Lib/dos_8x3/test_ima.py +++ b/Lib/dos_8x3/test_ima.py @@ -152,20 +152,13 @@ def getimage(name): return (image, sizes[0], sizes[1]) def get_qualified_path(name): - """ return a more qualified path to name contructed from argv[1]""" + """ return a more qualified path to name""" import sys import os - import string - - # get a more qualified path component of the script... - if __name__ == '__main__': - ourname = sys.argv[0] - else: # ...or the full path of the module - ourname = sys.modules[__name__].__file__ - - parts = string.splitfields(ourname, os.sep) - parts[-1] = name - name = string.joinfields(parts, os.sep) + for dir in sys.path: + fullname = os.path.join(dir, name) + if os.path.exists(fullname): + return fullname return name # rgbimg (unlike imgfile) is portable to platforms other than SGI. |