run-dev: Ignore certain request.finish() exceptions.

(imported from commit e797c0a6f5cd753bd84069bff202b421f0ff3be9)
This commit is contained in:
Tim Abbott 2013-08-21 12:01:40 -04:00
parent 33872fc427
commit 8879b84293
1 changed files with 10 additions and 0 deletions

View File

@ -9,6 +9,16 @@ from os import path
from twisted.internet import reactor
from twisted.web import proxy, server, resource
# Monkey-patch twisted.web.http to avoid request.finish exceptions
# https://trac.humbughq.com/ticket/1728
from twisted.web.http import Request
orig_finish = Request.finish
def patched_finish(self):
if self._disconnected:
return
return orig_finish(self)
Request.finish = patched_finish
parser = optparse.OptionParser(r"""
Starts the app listening on localhost, for local development.