X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/c6a031e623c7991ac9129f578dc21dffe2d7ede3..7aa37ea0adf864baf3ef3dfbcfaf5ff1ff780250:/src/black/concurrency.py diff --git a/src/black/concurrency.py b/src/black/concurrency.py index ce01657..55c96b6 100644 --- a/src/black/concurrency.py +++ b/src/black/concurrency.py @@ -9,6 +9,7 @@ import logging import os import signal import sys +import traceback from concurrent.futures import Executor, ProcessPoolExecutor, ThreadPoolExecutor from multiprocessing import Manager from pathlib import Path @@ -170,8 +171,10 @@ async def schedule_formatting( src = tasks.pop(task) if task.cancelled(): cancelled.append(task) - elif task.exception(): - report.failed(src, str(task.exception())) + elif exc := task.exception(): + if report.verbose: + traceback.print_exception(type(exc), exc, exc.__traceback__) + report.failed(src, str(exc)) else: changed = Changed.YES if task.result() else Changed.NO # If the file was written back or was successfully checked as