Skip to content

Commit

Permalink
Force black to use one worker (#270)
Browse files Browse the repository at this point in the history
wpiformat already uses a process pool, and we need to keep the total
number of multiprocessing processes below the Windows system limit.
  • Loading branch information
calcmogul authored Jan 11, 2024
1 parent 1b8f851 commit 3da80e2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion wpiformat/wpiformat/pyformat.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ def should_process_file(config_file, name):
@staticmethod
def run_batch(config_file, names):
try:
args = [sys.executable, "-m", "black", "-q"]
# Force one worker because wpiformat already uses a process pool,
# and we need to keep the total number of multiprocessing processes
# below the Windows system limit.
args = [sys.executable, "-m", "black", "--workers", "1", "-q"]
subprocess.run(args + names)
except FileNotFoundError:
print("Error: black not found in PATH. Is it installed?", file=sys.stderr)
Expand Down

0 comments on commit 3da80e2

Please sign in to comment.