File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4444
4545- Black no longer attempts to provide special errors for attempting to format Python 2
4646 code (#3933 )
47+ - Black will more consistently print stacktraces on internal errors in verbose mode
48+ (#3938 )
4749
4850### _ Blackd_
4951
Original file line number Diff line number Diff line change 99import os
1010import signal
1111import sys
12+ import traceback
1213from concurrent .futures import Executor , ProcessPoolExecutor , ThreadPoolExecutor
1314from multiprocessing import Manager
1415from pathlib import Path
@@ -170,8 +171,10 @@ async def schedule_formatting(
170171 src = tasks .pop (task )
171172 if task .cancelled ():
172173 cancelled .append (task )
173- elif task .exception ():
174- report .failed (src , str (task .exception ()))
174+ elif exc := task .exception ():
175+ if report .verbose :
176+ traceback .print_exception (type (exc ), exc , exc .__traceback__ )
177+ report .failed (src , str (exc ))
175178 else :
176179 changed = Changed .YES if task .result () else Changed .NO
177180 # If the file was written back or was successfully checked as
You can’t perform that action at this time.
0 commit comments