mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Remaining Python 3 compatibility changes
Summary: Biggest change is turning everything to unicode Test Plan: The tests Reviewers: dsagal, paulfitz Reviewed By: dsagal Differential Revision: https://phab.getgrist.com/D2875
This commit is contained in:
@@ -142,8 +142,9 @@ class TzInfo(_tzinfo):
|
||||
def tzname(self, dt):
|
||||
"""Implementation of tzinfo.tzname interface."""
|
||||
abbr = self.zone.dt_tzname(dt, self._favor_offset)
|
||||
# tzname must return a string, not unicode.
|
||||
return abbr.encode('utf8') if isinstance(abbr, unicode) else abbr
|
||||
if six.PY2 and isinstance(abbr, six.text_type):
|
||||
abbr = abbr.encode('utf8')
|
||||
return abbr
|
||||
|
||||
def dst(self, dt):
|
||||
"""Implementation of tzinfo.dst interface."""
|
||||
|
||||
Reference in New Issue
Block a user