Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit c072c0b

Browse files
authored
Fix mypy for platforms without epoll support. (#11771)
1 parent 7ad7a47 commit c072c0b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

changelog.d/11771.misc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Improve accuracy of `python_twisted_reactor_tick_time` prometheus metric.

synapse/metrics/_reactor_metrics.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
class EpollWrapper:
3636
"""a wrapper for an epoll object which records the time between polls"""
3737

38-
def __init__(self, poller: "select.epoll"):
38+
def __init__(self, poller: "select.epoll"): # type: ignore[name-defined]
3939
self.last_polled = time.time()
4040
self._poller = poller
4141

@@ -71,7 +71,7 @@ def collect(self) -> Iterable[Metric]:
7171
# if the reactor has a `_poller` attribute, which is an `epoll` object
7272
# (ie, it's an EPollReactor), we wrap the `epoll` with a thing that will
7373
# measure the time between ticks
74-
from select import epoll
74+
from select import epoll # type: ignore[attr-defined]
7575

7676
poller = reactor._poller # type: ignore[attr-defined]
7777
except (AttributeError, ImportError):

0 commit comments

Comments
 (0)