mirror of
https://github.com/python/cpython.git
synced 2025-12-23 09:19:18 +00:00
[3.14] gh-59000: Fix pdb breakpoint resolution for class methods when module not imported (GH-141949) (#142171)
gh-59000: Fix pdb breakpoint resolution for class methods when module not imported (GH-141949)
(cherry picked from commit 5e58548ebe)
Co-authored-by: LloydZ <35182391+cocolato@users.noreply.github.com>
This commit is contained in:
parent
5c5670eb45
commit
15a25f44ee
3 changed files with 20 additions and 1 deletions
|
|
@ -1481,7 +1481,9 @@ class Pdb(bdb.Bdb, cmd.Cmd):
|
|||
f = self.lookupmodule(parts[0])
|
||||
if f:
|
||||
fname = f
|
||||
item = parts[1]
|
||||
item = parts[1]
|
||||
else:
|
||||
return failed
|
||||
answer = find_function(item, self.canonic(fname))
|
||||
return answer or failed
|
||||
|
||||
|
|
|
|||
|
|
@ -4573,6 +4573,22 @@ def bœr():
|
|||
]))
|
||||
self.assertIn('break in bar', stdout)
|
||||
|
||||
def test_issue_59000(self):
|
||||
script = """
|
||||
def foo():
|
||||
pass
|
||||
|
||||
class C:
|
||||
def foo(self):
|
||||
pass
|
||||
"""
|
||||
commands = """
|
||||
break C.foo
|
||||
quit
|
||||
"""
|
||||
stdout, stderr = self.run_pdb_script(script, commands)
|
||||
self.assertIn("The specified object 'C.foo' is not a function", stdout)
|
||||
|
||||
|
||||
class ChecklineTests(unittest.TestCase):
|
||||
def setUp(self):
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
Fix :mod:`pdb` breakpoint resolution for class methods when the module defining the class is not imported.
|
||||
Loading…
Add table
Add a link
Reference in a new issue