mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-19 17:14:43 +04:00
prevent mypy from failing on systems without os.sched_getaffinity
This commit is contained in:
parent
de8590064e
commit
208a581231
1 changed files with 1 additions and 1 deletions
|
|
@ -28,7 +28,7 @@ def cpu_count() -> int:
|
||||||
# On systems that support it, this will return a more accurate count of
|
# On systems that support it, this will return a more accurate count of
|
||||||
# usable CPUs for the current process, which will take into account
|
# usable CPUs for the current process, which will take into account
|
||||||
# cgroup limits
|
# cgroup limits
|
||||||
return len(os.sched_getaffinity(0))
|
return len(os.sched_getaffinity(0)) # type: ignore[attr-defined]
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue