gh-93696: Fixed the breakpoint display error for frozen modules (#132862)

This commit is contained in:
Tian Gao 2025-04-24 13:07:27 -07:00 committed by GitHub
parent 0a387b311e
commit eef49c3595
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 19 additions and 10 deletions

View file

@ -1971,12 +1971,6 @@ class Pdb(bdb.Bdb, cmd.Cmd):
if last is None:
last = first + 10
filename = self.curframe.f_code.co_filename
# gh-93696: stdlib frozen modules provide a useful __file__
# this workaround can be removed with the closure of gh-89815
if filename.startswith("<frozen"):
tmp = self.curframe.f_globals.get("__file__")
if isinstance(tmp, str):
filename = tmp
breaklist = self.get_file_breaks(filename)
try:
lines = linecache.getlines(filename, self.curframe.f_globals)