Skip to content
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
Clarify that gh-89815 is a superceding issue
  • Loading branch information
SnoopJ committed Jul 22, 2022
commit 55f2a0f0b317bec41196b7acaa6b717fc72ca57f
3 changes: 2 additions & 1 deletion Lib/pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1332,7 +1332,8 @@ def do_list(self, arg):
if last is None:
last = first + 10
filename = self.curframe.f_code.co_filename
# gh-93696: stdlib frozen modules provide a useful __file__ (see also gh-89815)
# gh-93696: stdlib frozen modules provide a useful __file__
# this workaround can be removed with the closure of gh-89815
if filename.startswith("<frozen"):
if "__file__" in self.curframe.f_globals:
filename = self.curframe.f_globals["__file__"]
Copy link
Member

@JelleZijlstra JelleZijlstra Oct 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if __file__ is not a string? It looks like get_file_breaks will crash in that case. We should probably just ignore __file__ in that case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, that's a good point. I would think it's a small edge, but it's easy to be more cautious about it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think it's important for a debugger to be resilient in the face of unusual program state.

Expand Down