Skip to content

Commit

Permalink
iostream: check that stream is open before trying to read (tornadoweb…
Browse files Browse the repository at this point in the history
  • Loading branch information
Zsailer authored and bdarnell committed Jun 22, 2019
1 parent 442a812 commit 12094c3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tornado/iostream.py
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,7 @@ def _handle_read(self) -> None:
self._read_from_buffer(pos)

def _start_read(self) -> Future:
self._check_closed() # Before reading, check that stream is not closed.
assert self._read_future is None, "Already reading"
self._read_future = Future()
return self._read_future
Expand Down

0 comments on commit 12094c3

Please sign in to comment.