Showing the changes to python/lib (1 of 1 file). Show all
Unified · Split
| @@ -18,7 +18,9 @@ def slice_source_at_stamps(source_file, timestamps, timestamps_end=None, · 17 unmodified lines | ||
| 18 | 18 | timestamps_end = [timestamps[1] - 1] + timestamps_end |
| 19 | 19 | |
| 20 | 20 | if timestamps_end is not None: |
| 21 | − if len(timestamps_end) != len(timestamps): | |
| 21 | + if len(timestamps_end) == len(timestamps) - 1: | |
| 22 | + timestamps_end = timestamps_end + [_max_timestamp] | |
| 23 | + elif len(timestamps_end) != len(timestamps): | |
| 22 | 24 | raise ValueError("len(timestamps_end) != len(timestamps)") |
| 23 | 25 | else: |
| 24 | 26 | timestamps_end = [t - 1 for t in timestamps[1:]] + [_max_timestamp] |