Mercurial > cpython-lru_cache-weakref
diff Python/thread_pthread.h @ 5340:db673e98f28d legacy-trunk
Expand one level of symbolic link in sys.argv[0] before inserting its
dirname in sys.path. This means that you can create a symbolic link
foo in /usr/local/bin pointing to /usr/yourname/src/foo/foo.py, and
then invoking foo will insert /usr/yourname/src/foo in sys.path, not
/usr/local/bin. This makes it easier to have multifile programs
(before, the program would have to do an os.readlink(sys.argv[0])
itself and insert the resulting directory in sys.path -- Grail does
this).
Note that the expansion is only used for sys.path; sys.argv[0] is
still the original, unadorned filename (/usr/local/bin/foo in the
example).
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Fri, 25 Apr 1997 15:38:31 +0000 |
| parents | 9bc652e9f2b4 |
| children | 2c81d7d68ed3 |
