Fix compatility with tornado 6 (#2001)

This commit is contained in:
Marwan Rabbâa 2019-06-04 23:17:01 +02:00 committed by Randall Leeds
parent b15712924f
commit dc7b5d5c48

View File

@ -105,9 +105,11 @@ class TornadoWorker(Worker):
# instance of tornado.web.Application or is an
# instance of tornado.wsgi.WSGIApplication
app = self.wsgi
if not isinstance(app, tornado.web.Application) or \
isinstance(app, tornado.wsgi.WSGIApplication):
app = WSGIContainer(app)
if tornado.version_info[0] < 6:
if not isinstance(app, tornado.web.Application) or \
isinstance(app, tornado.wsgi.WSGIApplication):
app = WSGIContainer(app)
# Monkey-patching HTTPConnection.finish to count the
# number of requests being handled by Tornado. This