Skip to content

Commit 601bc1b

Browse files
yihong0618picnixz
andcommitted
fix: need to be string in defaultFile
Signed-off-by: yihong0618 <zouzou0208@gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
1 parent a136458 commit 601bc1b

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
@@ -1413,9 +1413,9 @@ def do_break(self, arg, temporary=False):
14131413
def defaultFile(self):
14141414
"""Produce a reasonable default."""
14151415
if self.curframe is None:
1416-
self.error("No current frame.")
1417-
return None
1418-
filename = self.curframe.f_code.co_filename
1416+
filename = '<string>'
1417+
else:
1418+
filename = self.curframe.f_code.co_filename
14191419
if filename == '<string>' and self.mainpyfile:
14201420
filename = self.mainpyfile
14211421
return filename

0 commit comments

Comments
 (0)