From 7f5d33840c60e5e496834404e7214a6b527b5172 Mon Sep 17 00:00:00 2001 From: Daniel Hamill Date: Tue, 16 Sep 2025 15:38:35 -0700 Subject: [PATCH] =?UTF-8?q?Revert=20"Catch=20when=20bad=20time=20zone=20is?= =?UTF-8?q?=20found=20and=20proceed=20with=20out=20any=20zone=20infor?= =?UTF-8?q?=E2=80=A6"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hecdss/hecdss.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/hecdss/hecdss.py b/src/hecdss/hecdss.py index 03b9256..164ab60 100644 --- a/src/hecdss/hecdss.py +++ b/src/hecdss/hecdss.py @@ -1,6 +1,6 @@ """Docstring for public module.""" from datetime import datetime, timedelta -from zoneinfo import ZoneInfo, ZoneInfoNotFoundError +from zoneinfo import ZoneInfo import numpy as np @@ -474,11 +474,7 @@ def _get_timeseries(self, pathname, startDateTime, endDateTime, trim): julian_base_date = julianBaseDate[0] timeZoneName = timeZoneName[0] if(timeZoneName): - try: - new_times = [i.replace(tzinfo=ZoneInfo(timeZoneName)) for i in new_times] - except ZoneInfoNotFoundError as e: - print(f"Warning: {e}. Using no zone instead.") - timeZoneName = False + new_times = [i.replace(tzinfo=ZoneInfo(timeZoneName)) for i in new_times] elif (DssPath(pathname).D.lower() == "ts-pattern"): new_times = [] start_date = _startDateTime - timedelta(seconds=interval_seconds)