8000 [3.8] bpo-42384: pdb: correctly populate sys.path[0] (GH-23338) by hexagonrecursion · Pull Request #24320 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[3.8] bpo-42384: pdb: correctly populate sys.path[0] (GH-23338) #24320

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 25, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix broken pdb tests
  • Loading branch information
hexagonrecursion committed Jan 25, 2021
commit 2a5808d49147b837ea946ef097176f80dc7251c5
6 changes: 3 additions & 3 deletions Lib/test/test_pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1667,14 +1667,14 @@ def test_issue42384(self):
""")
commands = 'c\nq'

with os_helper.temp_cwd() as cwd:
with support.temp_cwd() as cwd:
expected = f'(Pdb) sys.path[0] is {os.path.realpath(cwd)}'

stdout, stderr = self.run_pdb_script(script, commands)

self.assertEqual(stdout.split('\n')[2].rstrip('\r'), expected)

@os_helper.skip_unless_symlink
@support.skip_unless_symlink
def test_issue42384_symlink(self):
'''When running `python foo.py` sys.path[0] resolves symlinks. `python -m pdb foo.py` should behave the same'''
script = textwrap.dedent("""
Expand All @@ -1683,7 +1683,7 @@ def test_issue42384_symlink(self):
""")
commands = 'c\nq'

with os_helper.temp_cwd() as cwd:
with support.temp_cwd() as cwd:
cwd = os.path.realpath(cwd)
dir_one = os.path.join(cwd, 'dir_one')
dir_two = os.path.join(cwd, 'dir_two')
Expand Down
0