diff options
author | Erlend Egeberg Aasland <erlend.aasland@innova.no> | 2021-05-11 23:26:30 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-11 23:26:30 (GMT) |
commit | 8563a7052ccd98e6a381d361664ce567afd5eb6e (patch) | |
tree | 6a48de437ce5a5d2df98b62d1408c89226dbebfe /Lib/pdb.py | |
parent | c1df8808e054bbe4fe66f35ccc0f88d8b292778a (diff) | |
download | cpython-8563a7052ccd98e6a381d361664ce567afd5eb6e.zip cpython-8563a7052ccd98e6a381d361664ce567afd5eb6e.tar.gz cpython-8563a7052ccd98e6a381d361664ce567afd5eb6e.tar.bz2 |
bpo-28528: Fix pdb.checkline() attribute error when 'curframe' is None. (#25438)
Co-authored-by: Thomas Kluyver <takowl@gmail.com>
Diffstat (limited to 'Lib/pdb.py')
-rwxr-xr-x | Lib/pdb.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -752,7 +752,8 @@ class Pdb(bdb.Bdb, cmd.Cmd): """ # this method should be callable before starting debugging, so default # to "no globals" if there is no current frame - globs = self.curframe.f_globals if hasattr(self, 'curframe') else None + frame = getattr(self, 'curframe', None) + globs = frame.f_globals if frame else None line = linecache.getline(filename, lineno, globs) if not line: self.message('End of file') |