Skip to content

Commit 98fa9cc

Browse files
fix(jmap): remove duplicate pytz block left by partial suggestion apply
1 parent 791aa42 commit 98fa9cc

1 file changed

Lines changed: 0 additions & 17 deletions

File tree

caldav/jmap/convert/jscal_to_ical.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,6 @@ def _start_to_dtstart(
7171

7272
dt_naive = datetime.strptime(start_str[:19], "%Y-%m-%dT%H:%M:%S")
7373

74-
if time_zone:
75-
76-
def _add_dtstart_tzid_passthrough():
77-
dtstart = icalendar.vDatetime(dt_naive)
78-
dtstart.params["TZID"] = time_zone
7974
if time_zone:
8075
try:
8176
tz = ZoneInfo(time_zone)
@@ -87,18 +82,6 @@ def _add_dtstart_tzid_passthrough():
8782
dtstart = icalendar.vDatetime(dt_naive)
8883
dtstart.params["TZID"] = time_zone
8984
component.add("dtstart", dtstart)
90-
91-
try:
92-
import pytz # type: ignore[import]
93-
94-
try:
95-
tz = pytz.timezone(time_zone)
96-
dt = tz.localize(dt_naive)
97-
component.add("dtstart", dt)
98-
except pytz.exceptions.UnknownTimeZoneError:
99-
_add_dtstart_tzid_passthrough()
100-
except ImportError:
101-
_add_dtstart_tzid_passthrough()
10285
else:
10386
component.add("dtstart", dt_naive)
10487

0 commit comments

Comments
 (0)