File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed
Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 11# Change Log
22
3+ ## [ Unreleased]
4+
5+ ### Fixed
6+
7+ - Fixed handling of ` pytz ` timezones.
8+
9+
310## [ 2.0.2] - 2018-05-29
411
512### Fixed
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ def _safe_timezone(obj):
7070 elif isinstance (obj , _datetime .tzinfo ):
7171 # pytz
7272 if hasattr (obj , 'localize' ):
73- obj = timezone ( obj .zone )
73+ obj = obj .zone
7474 else :
7575 offset = obj .utcoffset (None )
7676
Original file line number Diff line number Diff line change 1+ import pytz
2+
3+ from pendulum import _safe_timezone
4+ from pendulum .tz .timezone import Timezone
5+
6+
7+ def test_safe_timezone_with_tzinfo_objects ():
8+ tz = _safe_timezone (pytz .timezone ("Europe/Paris" ))
9+
10+ assert isinstance (tz , Timezone )
11+ assert "Europe/Paris" == tz .name
You can’t perform that action at this time.
0 commit comments