mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-42384: pdb: correctly populate sys.path[0] (GH-23338)
Automerge-Triggered-By: GH:gvanrossum
This commit is contained in:
parent
5e45f1c8e7
commit
8603dfb421
3 changed files with 45 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue