diff options
Diffstat (limited to 'tools/TimeFileMaker.py')
| -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) |
