Skip to content
This repository was archived by the owner on Jan 13, 2021. It is now read-only.

Commit a4a55a7

Browse files
committed
Allow streams to close repeatedly.
1 parent 15760f4 commit a4a55a7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

hyper/http20/connection.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,11 @@ def _close_stream(self, stream_id):
343343
"""
344344
Called by a stream when it would like to be 'closed'.
345345
"""
346-
del self.streams[stream_id]
346+
try:
347+
del self.streams[stream_id]
348+
except KeyError:
349+
# If the stream is already missing from the dict, no-one cares.
350+
pass
347351

348352
def _send_cb(self, frame):
349353
"""

0 commit comments

Comments
 (0)