Skip to content

Commit 2a14b57

Browse files
committed
CLN: remove unnecessary is not None check
1 parent e83ff29 commit 2a14b57

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pandas/_libs/tslibs/conversion.pyx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -383,11 +383,10 @@ cdef _TSObject convert_datetime_to_tsobject(datetime ts, object tz,
383383
else:
384384
obj.value = pydatetime_to_dt64(ts, &obj.dts)
385385
# GH 24329 Take DST offset into account
386-
if ts.tzinfo is not None:
387-
if treat_tz_as_dateutil(ts.tzinfo):
388-
if ts.tzinfo.is_ambiguous(ts):
389-
dst_offset = ts.tzinfo.dst(ts)
390-
obj.value += int(dst_offset.total_seconds() * 1e9)
386+
if treat_tz_as_dateutil(ts.tzinfo):
387+
if ts.tzinfo.is_ambiguous(ts):
388+
dst_offset = ts.tzinfo.dst(ts)
389+
obj.value += int(dst_offset.total_seconds() * 1e9)
391390
obj.tzinfo = ts.tzinfo
392391

393392
if obj.tzinfo is not None and not is_utc(obj.tzinfo):

0 commit comments

Comments
 (0)