We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 908cc35 commit 5cfb27eCopy full SHA for 5cfb27e
set_edge_weights.py
@@ -3,6 +3,7 @@
3
import argparse
4
import csv
5
import logging
6
+import os
7
import pathlib
8
import sys
9
import typing
@@ -89,8 +90,15 @@ def main():
89
90
edge_sizes = get_edge_sizes(include_analysis, config.includeDirs if config else None)
91
csv_writer = csv.writer(sys.stdout)
92
- for row in set_edge_weights(args.changes_file, edge_sizes):
93
- csv_writer.writerow(row)
+ try:
94
+ for row in set_edge_weights(args.changes_file, edge_sizes):
95
+ csv_writer.writerow(row)
96
+
97
+ sys.stdout.flush()
98
+ except BrokenPipeError:
99
+ devnull = os.open(os.devnull, os.O_WRONLY)
100
+ os.dup2(devnull, sys.stdout.fileno())
101
+ sys.exit(1)
102
103
return 0
104
0 commit comments