mirror of
https://github.com/mvt-project/mvt.git
synced 2026-07-09 06:28:41 +02:00
Narrow bare except to specific exception types in convert_mactime_to_datetime
This commit is contained in:
@@ -119,10 +119,9 @@ def convert_mactime_to_datetime(timestamp: Union[int, float], from_2001: bool =
|
|||||||
if from_2001:
|
if from_2001:
|
||||||
timestamp = timestamp + 978307200
|
timestamp = timestamp + 978307200
|
||||||
|
|
||||||
# TODO: This is rather ugly. Happens sometimes with invalid timestamps.
|
|
||||||
try:
|
try:
|
||||||
return convert_unix_to_utc_datetime(timestamp)
|
return convert_unix_to_utc_datetime(timestamp)
|
||||||
except Exception:
|
except (OSError, OverflowError, ValueError):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user