Skip to content

Commit baaf28a

Browse files
committed
Make message and error handle non-string args
The base class sometimes calls these methods with an exception object.
1 parent 27c6780 commit baaf28a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Lib/pdb.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2540,11 +2540,13 @@ def _send(self, **kwargs) -> None:
25402540
# return an empty string because the socket may be half-closed.
25412541
self._write_failed = True
25422542

2543+
@typing.override
25432544
def message(self, msg, end="\n"):
2544-
self._send(message=msg + end)
2545+
self._send(message=str(msg) + end)
25452546

2547+
@typing.override
25462548
def error(self, msg):
2547-
self._send(error=msg)
2549+
self._send(error=str(msg))
25482550

25492551
def _read_command(self) -> str:
25502552
# Loop until we get a command for PDB or an 'interact' REPL.

0 commit comments

Comments
 (0)