Skip to content

Commit 4010b04

Browse files
Erlend E. Aaslandiritkatriel
andcommitted
Address review: make error handling more explicit
Co-authored-by: Irit Katriel <[email protected]>
1 parent c64b709 commit 4010b04

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Lib/pdb.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -752,10 +752,7 @@ def checkline(self, filename, lineno):
752752
"""
753753
# this method should be callable before starting debugging, so default
754754
# to "no globals" if there is no current frame
755-
try:
756-
globs = self.curframe.f_globals
757-
except AttributeError:
758-
globs = None
755+
globs = self.curframe.f_globals if getattr(self, "curframe", None) else None
759756
line = linecache.getline(filename, lineno, globs)
760757
if not line:
761758
self.message('End of file')

0 commit comments

Comments
 (0)