PY-53088 Make syspath.py helper work regardless of the way it's launched

Previously, it relied on the path the script was launched with to detect and
exclude "helpers" root from the results. Now it uses __file__ to find
the directory it resides in.

GitOrigin-RevId: fd3edce1a6a33fd82607953f75cafa5c558373cd
This commit is contained in:
Mikhail Golubev
2022-02-18 18:38:53 +02:00
committed by intellij-monorepo-bot
parent abf8acd8ba
commit d2e5565c9e

View File

@@ -1,4 +1,8 @@
import sys
import os.path
for x in sys.path:
if x != os.path.dirname(sys.argv [0]) and x != '.': sys.stdout.write(x+chr(10))
import sys
_helpers_root = os.path.dirname(os.path.abspath(__file__))
for root in sys.path:
if root != _helpers_root and root != os.curdir:
print(root)