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 | timestamps_end = [timestamps[1] - 1] + timestamps_end | 18 | timestamps_end = [timestamps[1] - 1] + timestamps_end |
| 19 | 19 | ||
| 20 | if timestamps_end is not None: | 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 | raise ValueError("len(timestamps_end) != len(timestamps)") | 24 | raise ValueError("len(timestamps_end) != len(timestamps)") |
| 23 | else: | 25 | else: |
| 24 | timestamps_end = [t - 1 for t in timestamps[1:]] + [_max_timestamp] | 26 | timestamps_end = [t - 1 for t in timestamps[1:]] + [_max_timestamp] |