mirror of
https://github.com/rembo10/headphones.git
synced 2026-07-20 16:03:59 +01:00
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:
@@ -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
@@ -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
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user