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 ploxiln committed Jul 4, 2019
1 parent a99f147 commit 8673547
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 @@ -856,6 +856,7 @@ def _handle_read(self):
self._maybe_run_close_callback()

def _set_read_callback(self, callback):
self._check_closed() # Before reading, check that stream is not closed.
assert self._read_callback is None, "Already reading"
assert self._read_future is None, "Already reading"
if callback is not None:
Expand Down

0 comments on commit 8673547

Please sign in to comment.