fix mypy error

os.cpu_count can return None.
This commit is contained in:
John Vandenberg 2021-10-08 18:55:16 +08:00
parent 93dc01f875
commit af646f42e0

View file

@ -264,7 +264,7 @@ def main(
if temp_file is None or (reformat is False and check is False):
echo()
worker_count = os.cpu_count()
worker_count = os.cpu_count() or 1
if sys.platform == "win32":
# Work around https://bugs.python.org/issue26903