X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/2082a325fdd14f0aabd88f7f12a20f9fb085c538..45c98cf150674dd49cb51d57f8baede4c287f043:/src/black/__init__.py?ds=sidebyside diff --git a/src/black/__init__.py b/src/black/__init__.py index 3ab4bc7..41c688b 100644 --- a/src/black/__init__.py +++ b/src/black/__init__.py @@ -662,9 +662,9 @@ def reformat_many( worker_count = min(worker_count, 61) try: executor = ProcessPoolExecutor(max_workers=worker_count) - except OSError: + except (ImportError, OSError): # we arrive here if the underlying system does not support multi-processing - # like in AWS Lambda, in which case we gracefully fallback to + # like in AWS Lambda or Termux, in which case we gracefully fallback to # a ThreadPollExecutor with just a single worker (more workers would not do us # any good due to the Global Interpreter Lock) executor = ThreadPoolExecutor(max_workers=1)