File tree 1 file changed +23
-0
lines changed
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -1798,6 +1798,29 @@ def test_pdb_issue_gh_101517():
1798
1798
(Pdb) continue
1799
1799
"""
1800
1800
1801
+ def test_pdb_issue_gh_104301 ():
1802
+ """See GH-104301
1803
+
1804
+ Make sure that ambiguous statements prefixed by '!' are properly disambiguated
1805
+
1806
+ >>> with PdbTestInput([
1807
+ ... '! n = 42', # disambiguated statement: reassign the name n
1808
+ ... 'n', # advance the debugger into the print()
1809
+ ... 'continue'
1810
+ ... ]):
1811
+ ... n = -1
1812
+ ... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
1813
+ ... print(n)
1814
+ > <doctest test.test_pdb.test_pdb_issue_gh_104301[0]>(8)<module>()
1815
+ -> print(n)
1816
+ (Pdb) ! n = 42
1817
+ (Pdb) n
1818
+ 42
1819
+ > <doctest test.test_pdb.test_pdb_issue_gh_104301[0]>(1)<module>()
1820
+ -> with PdbTestInput([
1821
+ (Pdb) continue
1822
+ """
1823
+
1801
1824
1802
1825
@support .requires_subprocess ()
1803
1826
class PdbTestCase (unittest .TestCase ):
You can’t perform that action at this time.
0 commit comments