run-dev: Remove unnecessary finish calls.

Tornado finishes the request automatically.  Avoids this error, hidden
until commit 81f7192ca3 (#22301), when
the browser tab is closed:

Traceback (most recent call last):
  File "/srv/zulip-py3-venv/lib/python3.8/site-packages/tornado/web.py", line 1683, in _execute
    result = await result
  File "tools/run-dev.py", line 280, in prepare
    await self.finish()
tornado.iostream.StreamClosedError: Stream is closed

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2022-06-26 11:46:50 -07:00 committed by Tim Abbott
parent 0dfde9db94
commit d5c302feef
1 changed files with 0 additions and 2 deletions

View File

@ -277,11 +277,9 @@ class BaseHandler(web.RequestHandler):
self.add_header(header, v)
if response.body:
self.write(response.body)
await self.finish()
except (ConnectionError, httpclient.HTTPError) as e:
self.set_status(500)
self.write("Internal server error:\n" + str(e))
await self.finish()
class WebPackHandler(BaseHandler):