From 90a0fbb8f42898de8fdaea69a46b11214faf4722 Mon Sep 17 00:00:00 2001 From: crusaderky Date: Sat, 23 Apr 2022 00:57:26 +0100 Subject: [PATCH] Pass mypy validation on Windows --- distributed/comm/asyncio_tcp.py | 2 +- distributed/pytest_resourceleaks.py | 2 +- distributed/system.py | 2 +- distributed/tests/test_utils_test.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/distributed/comm/asyncio_tcp.py b/distributed/comm/asyncio_tcp.py index 84ba45f0183..1dbac5fef6f 100644 --- a/distributed/comm/asyncio_tcp.py +++ b/distributed/comm/asyncio_tcp.py @@ -777,7 +777,7 @@ class _ZeroCopyWriter: # pass to sendmsg. if hasattr(socket.socket, "sendmsg"): try: - SENDMSG_MAX_COUNT = os.sysconf("SC_IOV_MAX") + SENDMSG_MAX_COUNT = os.sysconf("SC_IOV_MAX") # type: ignore except Exception: SENDMSG_MAX_COUNT = 16 # Should be supported on all systems else: diff --git a/distributed/pytest_resourceleaks.py b/distributed/pytest_resourceleaks.py index a6e590b7dc0..b8db97a0bcb 100644 --- a/distributed/pytest_resourceleaks.py +++ b/distributed/pytest_resourceleaks.py @@ -158,7 +158,7 @@ def measure(self) -> int: if WINDOWS: # Don't use num_handles(); you'll get tens of thousands of reported leaks return 0 - return psutil.Process().num_fds() + return psutil.Process().num_fds() # type: ignore def has_leak(self, before: int, after: int) -> bool: return after > before diff --git a/distributed/system.py b/distributed/system.py index ad981e8b1cf..27e896b89a2 100644 --- a/distributed/system.py +++ b/distributed/system.py @@ -30,7 +30,7 @@ def memory_limit() -> int: try: import resource - hard_limit = resource.getrlimit(resource.RLIMIT_RSS)[1] + hard_limit = resource.getrlimit(resource.RLIMIT_RSS)[1] # type: ignore if hard_limit > 0: limit = min(limit, hard_limit) except (ImportError, OSError): diff --git a/distributed/tests/test_utils_test.py b/distributed/tests/test_utils_test.py index 81ee8a850f2..3d4c7aee4d5 100755 --- a/distributed/tests/test_utils_test.py +++ b/distributed/tests/test_utils_test.py @@ -543,7 +543,7 @@ async def test_dump_cluster_unresponsive_remote_worker(c, s, a, b, tmpdir): def garbage_process(barrier, ignore_sigterm: bool = False, t: float = 3600) -> None: if ignore_sigterm: - for signum in (signal.SIGTERM, signal.SIGHUP, signal.SIGINT): + for signum in (signal.SIGTERM, signal.SIGHUP, signal.SIGINT): # type: ignore signal.signal(signum, signal.SIG_IGN) barrier.wait() sleep(t)