Skip to content

Commit 5abd63a

Browse files
committed
Update the comment to explain why we catch two exception types
1 parent 02da647 commit 5abd63a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Lib/pdb.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2679,8 +2679,9 @@ def _send(self, **kwargs):
26792679
self._sockfile.write(json_payload.encode() + b"\n")
26802680
self._sockfile.flush()
26812681
except (OSError, ValueError):
2682-
# This means that the client has abruptly disconnected, but we'll
2683-
# handle that the next time we try to read from the client instead
2682+
# We get an OSError if the network connection has dropped, and a
2683+
# ValueError if detach() if the sockfile has been closed. We'll
2684+
# handle this the next time we try to read from the client instead
26842685
# of trying to handle it from everywhere _send() may be called.
26852686
# Track this with a flag rather than assuming readline() will ever
26862687
# return an empty string because the socket may be half-closed.

0 commit comments

Comments
 (0)