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

Commit 5fd6731

Browse files
committed
Allow read() calls on exhausted streams.
1 parent 87172ef commit 5fd6731

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

hyper/http20/stream.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ def _read(self, amt=None):
109109
Read data from the stream. Unlike a normal read behaviour, this
110110
function returns _at least_ ``amt`` data, but may return more.
111111
"""
112+
if self.state == STATE_CLOSED:
113+
return b''
114+
112115
assert self.state in (STATE_OPEN, STATE_HALF_CLOSED_LOCAL)
113116

114117
def listlen(list):

0 commit comments

Comments
 (0)