Skip to content

Commit

Permalink
Fixed multiprocessing issue on win64 with more than 60 cores (#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
inuik committed Oct 14, 2022
1 parent b853bb3 commit ddd4af3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion autoflake.py
Expand Up @@ -1453,7 +1453,11 @@ def _main(argv, standard_out, standard_error, standard_input=None) -> int:
args["exclude"] = set()

if args["jobs"] < 1:
args["jobs"] = os.cpu_count() or 1
worker_count = os.cpu_count()
if sys.platform == "win32":
# Work around https://bugs.python.org/issue26903
worker_count = min(worker_count, 60)
args["jobs"] = worker_count or 1

filenames = list(set(args["files"]))

Expand Down

0 comments on commit ddd4af3

Please sign in to comment.