Skip to content

Commit 772c151

Browse files
committed
Improves code for parsing of datetime with offset.
1 parent ce1ff8a commit 772c151

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

pendulum/pendulum.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,7 @@ def parse(cls, time=None, tz=pytz.UTC):
203203
raise PendulumException('Invalid time string "{}"'.format(time))
204204

205205
if dt.tzinfo:
206-
if isinstance(dt.tzinfo, tzoffset):
207-
tz = int(dt.tzinfo.utcoffset(None).total_seconds() / 3600)
208-
else:
209-
tz = tzinfo
206+
tz = int(dt.tzinfo.utcoffset(None).total_seconds() / 3600)
210207

211208
return cls(
212209
dt.year, dt.month, dt.day,

0 commit comments

Comments
 (0)