Skip to content

Commit 7f82d15

Browse files
committed
Windows can also return an OSError instead of a ValueError for a fromtimestamp overflow
1 parent 5ba8c2e commit 7f82d15

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python_utils/time.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def format_time(
130130

131131
try: # pragma: no cover
132132
dt = datetime.datetime.fromtimestamp(seconds)
133-
except ValueError: # pragma: no cover
133+
except (ValueError, OSError): # pragma: no cover
134134
dt = datetime.datetime.max
135135
return str(dt)
136136
elif isinstance(timestamp, datetime.date):

0 commit comments

Comments
 (0)