diff options
| author | Jason Gross | 2020-09-21 12:38:25 -0400 |
|---|---|---|
| committer | Jason Gross | 2020-09-21 12:42:14 -0400 |
| commit | fef5b75e72e1dc2889875616f56332a00dc50534 (patch) | |
| tree | 09eb1524b44597aa8f9a3cf6ee0033702484d863 /tools | |
| parent | 84d5475169ec0ba3d11928dab11eba6bc3d19d9b (diff) | |
Make print-pretty-timed robust against non-output-sync logs
Also pass `--output-sync` on the CI, as suggested in
https://github.com/coq/coq/pull/12653#issuecomment-696226093, to protect
against this failure mode.
Fixes #13062
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/TimeFileMaker.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/TimeFileMaker.py b/tools/TimeFileMaker.py index 12462726e5..72c7465b13 100644 --- a/tools/TimeFileMaker.py +++ b/tools/TimeFileMaker.py @@ -101,7 +101,12 @@ def add_output_file_name(parser): return add_file_name_gen(parser, 'OUTPUT_', 'f def reformat_time_string(time): - seconds, milliseconds = time.split('.') + try: + seconds, milliseconds = time.split('.') + except ValueError: + print('WARNING: Invalid time string: not the right number of dots (.); expected one: %s' % repr(time), file=sys.stderr) + seconds, milliseconds = (time + '.').split('.')[:2] + if seconds == '': seconds = 0 seconds = int(seconds) minutes, seconds = divmod(seconds, 60) return '%dm%02d.%ss' % (minutes, seconds, milliseconds) |
