Skip to content

Commit

Permalink
Ensure seconds for timedelta are a Python int
Browse files Browse the repository at this point in the history
  • Loading branch information
takluyver committed Jun 18, 2024
1 parent 2a1bfc4 commit 1508441
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion extra_data/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -1232,7 +1232,7 @@ def info(self, details_for_sources=()):
last_train = self.train_ids[-1]
seconds, deciseconds = divmod((last_train - first_train + 1), 10)
try:
td = datetime.timedelta(seconds=seconds)
td = datetime.timedelta(seconds=int(seconds))
except OverflowError: # Can occur if a train ID is corrupted
span_txt = "OverflowError (one or more train IDs are probably wrong)"
else:
Expand Down

0 comments on commit 1508441

Please sign in to comment.