mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-03 01:43:37 +00:00
20 lines
573 B
Python
20 lines
573 B
Python
|
from .tz import *
|
||
|
from six import PY3
|
||
|
|
||
|
__all__ = ["tzutc", "tzoffset", "tzlocal", "tzfile", "tzrange",
|
||
|
"tzstr", "tzical", "tzwin", "tzwinlocal", "gettz"]
|
||
|
|
||
|
def tzname_in_python2(namefunc):
|
||
|
"""Change unicode output into bytestrings in Python 2
|
||
|
|
||
|
tzname() API changed in Python 3. It used to return bytes, but was changed
|
||
|
to unicode strings
|
||
|
"""
|
||
|
def adjust_encoding(*args, **kwargs):
|
||
|
name = namefunc(*args, **kwargs)
|
||
|
if name is not None and not PY3:
|
||
|
name = name.encode()
|
||
|
|
||
|
return name
|
||
|
|
||
|
return adjust_encoding
|