https://github.com/jwilk/python-syspath-tracker
track who changes Python's sys.path
https://github.com/jwilk/python-syspath-tracker
python qa
Last synced: 11 days ago
JSON representation
track who changes Python's sys.path
- Host: GitHub
- URL: https://github.com/jwilk/python-syspath-tracker
- Owner: jwilk
- License: mit
- Created: 2018-02-24T12:33:26.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2025-02-25T15:26:22.000Z (5 months ago)
- Last Synced: 2025-03-20T09:19:05.819Z (4 months ago)
- Topics: python, qa
- Language: Python
- Size: 20.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
.. code:: console
$ cat test.py
import sys
import syspath_tracker
syspath_tracker.install()
def f():
sys.path += ['/eggs']
def g():
del sys.path[0]
f()
g()$ python test.py
Initial sys.path = [
'/home/jwilk/python-syspath-tracker',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-i386-linux-gnu',
'/usr/lib/python2.7/lib-tk',
'/usr/lib/python2.7/lib-old',
'/usr/lib/python2.7/lib-dynload',
'/usr/local/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages',
]
sys.path changed at test.py:5: [
'/home/jwilk/python-syspath-tracker',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-i386-linux-gnu',
'/usr/lib/python2.7/lib-tk',
'/usr/lib/python2.7/lib-old',
'/usr/lib/python2.7/lib-dynload',
'/usr/local/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages',
+ '/eggs',
]
sys.path changed at test.py:7: [
- '/home/jwilk/python-syspath-tracker',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-i386-linux-gnu',
'/usr/lib/python2.7/lib-tk',
'/usr/lib/python2.7/lib-old',
'/usr/lib/python2.7/lib-dynload',
'/usr/local/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages',
'/eggs',
].. vim:ft=rst ts=3 sts=3 sw=3 et