From 095869202817b8f76fabc05f75048c66cc49d9aa Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Sun, 7 Nov 2021 16:35:31 +0100 Subject: [PATCH] Suppress unnecessary traceback (#6253) --- tests/stubtest_third_party.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/stubtest_third_party.py b/tests/stubtest_third_party.py index 976c1fcda..9add3ed09 100755 --- a/tests/stubtest_third_party.py +++ b/tests/stubtest_third_party.py @@ -142,12 +142,15 @@ def main(): else: dists = [typeshed_dir / "stubs" / d for d in args.dists] - for i, dist in enumerate(dists): - if i % args.num_shards != args.shard_index: - continue - if dist.name in EXCLUDE_LIST: - continue - run_stubtest(dist) + try: + for i, dist in enumerate(dists): + if i % args.num_shards != args.shard_index: + continue + if dist.name in EXCLUDE_LIST: + continue + run_stubtest(dist) + except StubtestFailed: + sys.exit(1) if __name__ == "__main__":