summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Bienkowski <hexagonrecursion@gmail.com>2021-01-25 21:10:40 +0000
committerGitHub <noreply@github.com>2021-01-25 13:10:40 -0800
commitc10180ea1458aa0ffd7793cb75629ebffe8a257e (patch)
treeaccda02430e44c1a223d90c9324413ed0ba2382d /Lib/pdb.py
parentbpo-43013: Fix old tkinter module names in idlelib (GH-24326) (diff)
downloadcpython-c10180ea1458aa0ffd7793cb75629ebffe8a257e.tar.gz
cpython-c10180ea1458aa0ffd7793cb75629ebffe8a257e.tar.bz2
cpython-c10180ea1458aa0ffd7793cb75629ebffe8a257e.zip
[3.8] bpo-42384: pdb: correctly populate sys.path[0] (GH-23338) (#24320)
Diffstat (limited to 'Lib/pdb.py')
-rwxr-xr-xLib/pdb.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/pdb.py b/Lib/pdb.py
index d7d95715945..7a5192cbadc 100755
--- a/Lib/pdb.py
+++ b/Lib/pdb.py
@@ -1686,8 +1686,9 @@ def main():
sys.argv[:] = args # Hide "pdb.py" and pdb options from argument list
- # Replace pdb's dir with script's dir in front of module search path.
if not run_as_module:
+ mainpyfile = os.path.realpath(mainpyfile)
+ # Replace pdb's dir with script's dir in front of module search path.
sys.path[0] = os.path.dirname(mainpyfile)
# Note on saving/restoring sys.argv: it's a good idea when sys.argv was