Skip to content

Commit

Permalink
Report all stacktraces in verbose mode
Browse files Browse the repository at this point in the history
Previously these were swallowed (unlike the ones in black/__init__.py)
  • Loading branch information
hauntsaninja committed Oct 9, 2023
1 parent 715f60c commit 09b2420
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/black/concurrency.py
Expand Up @@ -12,6 +12,7 @@
from concurrent.futures import Executor, ProcessPoolExecutor, ThreadPoolExecutor
from multiprocessing import Manager
from pathlib import Path
import traceback
from typing import Any, Iterable, Optional, Set

from mypy_extensions import mypyc_attr
Expand Down Expand Up @@ -171,6 +172,8 @@ async def schedule_formatting(
if task.cancelled():
cancelled.append(task)
elif task.exception():
if report.verbose:
traceback.print_exception(task.exception())
report.failed(src, str(task.exception()))
else:
changed = Changed.YES if task.result() else Changed.NO
Expand Down

0 comments on commit 09b2420

Please sign in to comment.