Skip to content

GH-101673: Fix pdb bug that local variable changes lost after longlist #101674

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 7 commits into from
Mar 12, 2023
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
Next Next commit
Add regression test for the bug
  • Loading branch information
gaogaotiantian committed Mar 12, 2023
commit 121e00ba88d12173f1ba6e1f42e4d905c23dffd2
29 changes: 29 additions & 0 deletions Lib/test/test_pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1474,6 +1474,35 @@ def test_pdb_issue_gh_94215():
(Pdb) continue
"""

def test_pdb_issue_gh_101673():
"""See GH-101673

Make sure ll won't revert local variable assignment

>>> def test_function():
... a = 1
... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()

>>> with PdbTestInput([ # doctest: +NORMALIZE_WHITESPACE
... '!a = 2',
... 'll',
... 'p a',
... 'continue'
... ]):
... test_function()
--Return--
> <doctest test.test_pdb.test_pdb_issue_gh_101673[0]>(3)test_function()->None
-> import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
(Pdb) !a = 2
(Pdb) ll
1 def test_function():
2 a = 1
3 -> import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
(Pdb) p a
2
(Pdb) continue
"""


@support.requires_subprocess()
class PdbTestCase(unittest.TestCase):
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy