From dc7b5d5c4876b49f86ea2460698a335d0f5ef7c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marwan=20Rabb=C3=A2a?= <1440729+waghanza@users.noreply.github.com> Date: Tue, 4 Jun 2019 23:17:01 +0200 Subject: [PATCH] Fix compatility with tornado 6 (#2001) --- gunicorn/workers/gtornado.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gunicorn/workers/gtornado.py b/gunicorn/workers/gtornado.py index 40e5572a..c98acb85 100644 --- a/gunicorn/workers/gtornado.py +++ b/gunicorn/workers/gtornado.py @@ -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