Initial python3 changes

Mostly just updating libraries, removing string encoding/decoding,
fixing some edge cases. No new functionality was added in this
commit.
This commit is contained in:
rembo10
2022-01-14 10:38:03 +05:30
parent 9a7006ad14
commit ab4dd18be4
813 changed files with 146338 additions and 65753 deletions
+2 -2
View File
@@ -40,13 +40,13 @@ from pytz.tzfile import build_tzinfo, _byte_string
try:
unicode
str
except NameError: # Python 3.x
# Python 3.x doesn't have unicode(), making writing code
# for Python 2.3 and Python 3.x a pain.
unicode = str
str = str
def ascii(s):
r"""
+1 -1
View File
@@ -61,7 +61,7 @@ class LazyDict(DictMixin):
self._fill()
finally:
_fill_lock.release()
return self.data.keys()
return list(self.data.keys())
class LazyList(list):
+1 -1
View File
@@ -4,7 +4,7 @@ $Id: tzfile.py,v 1.8 2004/06/03 00:15:24 zenzen Exp $
'''
try:
from cStringIO import StringIO
from io import StringIO
except ImportError:
from io import StringIO
from datetime import datetime, timedelta
+1 -1
View File
@@ -548,7 +548,7 @@ def unpickler(zone, utcoffset=None, dstoffset=None, tzname=None):
# See if we can find an entry differing only by tzname. Abbreviations
# get changed from the initial guess by the database maintainers to
# match reality when this information is discovered.
for localized_tz in tz._tzinfos.values():
for localized_tz in list(tz._tzinfos.values()):
if (localized_tz._utcoffset == utcoffset
and localized_tz._dst == dstoffset):
return localized_tz