Skip to content

Commit 413b463

Browse files
committed
check=True, catch error instead
1 parent 8aaf791 commit 413b463

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

.evergreen/scripts/resync-all-specs.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import os
55
import pathlib
66
import subprocess
7+
from subprocess import CalledProcessError
78

89

910
def resync_specs(directory: pathlib.Path, errored: dict[str, str]) -> list[str]:
@@ -14,15 +15,15 @@ def resync_specs(directory: pathlib.Path, errored: dict[str, str]) -> list[str]:
1415

1516
if spec.name in ["asynchronous"]:
1617
continue
17-
process = subprocess.run(
18-
["bash", "./.evergreen/resync-specs.sh", spec.name], # noqa: S603, S607
19-
capture_output=True,
20-
text=True,
21-
check=False,
22-
)
23-
24-
if process.returncode != 0:
25-
errored[spec.name] = process.stderr
18+
try:
19+
subprocess.run(
20+
["bash", "./.evergreen/resync-specs.sh", spec.name], # noqa: S603, S607
21+
capture_output=True,
22+
text=True,
23+
check=True,
24+
)
25+
except CalledProcessError as exc:
26+
errored[spec.name] = exc.stderr
2627

2728
process = subprocess.run(
2829
["git diff --name-only | awk -F'/' '{print $2}' | sort | uniq"], # noqa: S607

0 commit comments

Comments
 (0)