if (self.mainpyfile != self.canonic(frame.f_code.co_filename)):
return
self._wait_for_mainpyfile = False
+ if self.trace_opcodes:
+ # GH-127321
+ # We want to avoid stopping at an opcode that does not have
+ # an associated line number because pdb does not like it
+ if frame.f_lineno is None:
+ self.set_stepinstr()
+ return
self.bp_commands(frame)
self.interaction(frame, None)
(Pdb) continue
"""
+def test_pdb_issue_gh_127321():
+ """See GH-127321
+ breakpoint() should stop at a opcode that has a line number
+ >>> def test_function():
+ ... import pdb; pdb_instance = pdb.Pdb(nosigint=True, readrc=False)
+ ... [1, 2] and pdb_instance.set_trace()
+ ... a = 1
+ >>> with PdbTestInput([ # doctest: +NORMALIZE_WHITESPACE
+ ... 'continue'
+ ... ]):
+ ... test_function()
+ > <doctest test.test_pdb.test_pdb_issue_gh_127321[0]>(4)test_function()
+ -> a = 1
+ (Pdb) continue
+ """
+
def test_pdb_issue_gh_80731():
"""See GH-80731