Add type: ignore for tornado_ioloop_logging Tornado versioning code.

This commit is contained in:
Tim Abbott
2016-01-27 15:56:09 -08:00
parent 53ab18eea0
commit b6dd6413d0

View File

@@ -10,9 +10,9 @@ from django.conf import settings
try:
# Tornado 2.4
orig_poll_impl = ioloop._poll
orig_poll_impl = ioloop._poll # type: ignore # cross-version type variation is hard for mypy
def instrument_tornado_ioloop():
ioloop._poll = InstrumentedPoll
ioloop._poll = InstrumentedPoll # type: ignore # cross-version type variation is hard for mypy
except:
# Tornado 3
from tornado.ioloop import IOLoop, PollIOLoop
@@ -21,7 +21,7 @@ except:
# be epoll.
orig_poll_impl = select.epoll
class InstrumentedPollIOLoop(PollIOLoop):
def initialize(self, **kwargs):
def initialize(self, **kwargs): # type: ignore # TODO investigate likely buggy monkey patching here
super(InstrumentedPollIOLoop, self).initialize(impl=InstrumentedPoll(), **kwargs)
def instrument_tornado_ioloop():