Skip to content

Commit

Permalink
Catch StreamClosedError in StaticFileHandler.
Browse files Browse the repository at this point in the history
  • Loading branch information
bdarnell committed Oct 12, 2014
1 parent a9c0e56 commit 86333d0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tornado/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -2172,8 +2172,11 @@ def get(self, path, include_body=True):
if isinstance(content, bytes):
content = [content]
for chunk in content:
self.write(chunk)
yield self.flush()
try:
self.write(chunk)
yield self.flush()
except iostream.StreamClosedError:
return
else:
assert self.request.method == "HEAD"

Expand Down

0 comments on commit 86333d0

Please sign in to comment.