1
0
mirror of https://github.com/esphome/esphome.git synced 2025-03-14 06:38:17 +00:00

Update esphome/core/config.py

This commit is contained in:
J. Nick Koston 2025-02-18 10:05:05 -06:00 committed by GitHub
parent 98517d08a0
commit c85def0680
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -94,6 +94,10 @@ def valid_project_name(value: str):
def get_usable_cpu_count() -> int:
"""Return the number of CPUs that can be used for processes.
On Python 3.13+ this is the number of CPUs that can be used for processes.
On older Python versions this is the number of CPUs.
"""
return (
os.process_cpu_count() if hasattr(os, "process_cpu_count") else os.cpu_count()
)