mirror of
https://github.com/zulip/zulip.git
synced 2025-11-21 15:09:34 +00:00
Add type: ignore for tornado_ioloop_logging Tornado versioning code.
This commit is contained in:
@@ -10,9 +10,9 @@ from django.conf import settings
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
# Tornado 2.4
|
# 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():
|
def instrument_tornado_ioloop():
|
||||||
ioloop._poll = InstrumentedPoll
|
ioloop._poll = InstrumentedPoll # type: ignore # cross-version type variation is hard for mypy
|
||||||
except:
|
except:
|
||||||
# Tornado 3
|
# Tornado 3
|
||||||
from tornado.ioloop import IOLoop, PollIOLoop
|
from tornado.ioloop import IOLoop, PollIOLoop
|
||||||
@@ -21,7 +21,7 @@ except:
|
|||||||
# be epoll.
|
# be epoll.
|
||||||
orig_poll_impl = select.epoll
|
orig_poll_impl = select.epoll
|
||||||
class InstrumentedPollIOLoop(PollIOLoop):
|
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)
|
super(InstrumentedPollIOLoop, self).initialize(impl=InstrumentedPoll(), **kwargs)
|
||||||
|
|
||||||
def instrument_tornado_ioloop():
|
def instrument_tornado_ioloop():
|
||||||
|
|||||||
Reference in New Issue
Block a user