Skip to content

Commit 3b44e21

Browse files
committed
signal errors during black_bindings
1 parent 7122cdc commit 3b44e21

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tools/black_bindings.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def transform(fn, s):
2828
)
2929
except subprocess.CalledProcessError as e:
3030
print(f"{fn}:0: Failed to process block:\n{s}")
31-
return s
31+
raise
3232

3333
result = result.stdout[len(prefix) :]
3434
result = (result.rstrip()).split("\n")
@@ -58,6 +58,11 @@ def process_one_file(fn):
5858
# Use a thread pool because most processing is inside black!
5959
executor = ThreadPoolExecutor(max_workers=os.cpu_count())
6060
futures = [executor.submit(process_one_file, fn) for fn in sys.argv[1:]]
61+
status = 0
6162
for f in futures:
62-
f.result()
63+
try:
64+
f.result()
65+
except Exception as e:
66+
status = 1
6367
executor.shutdown()
68+
raise SystemExit(status)

0 commit comments

Comments
 (0)