diff options
author | James Gerity <snoopjedi@gmail.com> | 2022-10-25 13:22:53 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-25 13:22:53 (GMT) |
commit | d91de288e73c67805e4c838b5f770ab7ec3661f9 (patch) | |
tree | b35272b46a434fb805ce28b4bbea0345e218a644 /Lib/pdb.py | |
parent | dd13b23e49b8c49bc751fe5ed470773a2d60b7d1 (diff) | |
download | cpython-d91de288e73c67805e4c838b5f770ab7ec3661f9.zip cpython-d91de288e73c67805e4c838b5f770ab7ec3661f9.tar.gz cpython-d91de288e73c67805e4c838b5f770ab7ec3661f9.tar.bz2 |
gh-93696: Locate frozen module source with __file__ (#93697)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Diffstat (limited to 'Lib/pdb.py')
-rwxr-xr-x | Lib/pdb.py | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -1332,6 +1332,12 @@ 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) |