From 208a581231c2afeffa80aba8406d32f3ce3b7c86 Mon Sep 17 00:00:00 2001 From: AleksaC Date: Sun, 29 Sep 2024 00:10:32 +0200 Subject: [PATCH] prevent mypy from failing on systems without os.sched_getaffinity --- pre_commit/xargs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pre_commit/xargs.py b/pre_commit/xargs.py index a1345b58..0cec44ef 100644 --- a/pre_commit/xargs.py +++ b/pre_commit/xargs.py @@ -28,7 +28,7 @@ def cpu_count() -> int: # On systems that support it, this will return a more accurate count of # usable CPUs for the current process, which will take into account # cgroup limits - return len(os.sched_getaffinity(0)) + return len(os.sched_getaffinity(0)) # type: ignore[attr-defined] except AttributeError: pass