Skip to content

Commit cb73cb0

Browse files
yihong0618picnixz
andcommitted
fix: follow the comments
Signed-off-by: yihong0618 <zouzou0208@gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
1 parent e4b6414 commit cb73cb0

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Lib/pdb.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2111,6 +2111,9 @@ def do_list(self, arg):
21112111
exception was originally raised or propagated is indicated by
21122112
">>", if it differs from the current line.
21132113
"""
2114+
if not self.curframe:
2115+
self.error('No current frame.')
2116+
return
21142117
self.lastcmd = 'list'
21152118
last = None
21162119
if arg and arg != '.':
@@ -2134,9 +2137,6 @@ def do_list(self, arg):
21342137
first = self.lineno + 1
21352138
if last is None:
21362139
last = first + 10
2137-
if not self.curframe:
2138-
self.error('No current frame.')
2139-
return
21402140
filename = self.curframe.f_code.co_filename
21412141
breaklist = self.get_file_breaks(filename)
21422142
try:

0 commit comments

Comments
 (0)