diff --git a/CHANGES.md b/CHANGES.md index 35024de724d..db519ac6bbc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,11 @@ # Change Log +## Unreleased + +### _Black_ + +- Fixed Python 3.10 support on platforms without ProcessPoolExecutor (#2631) + ## 21.11b1 ### _Black_ diff --git a/src/black/__init__.py b/src/black/__init__.py index a5ddec91221..aa7970cfd6c 100644 --- a/src/black/__init__.py +++ b/src/black/__init__.py @@ -687,7 +687,7 @@ def reformat_many( worker_count = min(worker_count, 60) try: executor = ProcessPoolExecutor(max_workers=worker_count) - except (ImportError, OSError): + except (ImportError, NotImplementedError, OSError): # we arrive here if the underlying system does not support multi-processing # like in AWS Lambda or Termux, in which case we gracefully fallback to # a ThreadPoolExecutor with just a single worker (more workers would not do us