Shorten hy._compat
This commit is contained in:
parent
ef3bad7e03
commit
5aaa7d92d8
|
@ -43,25 +43,10 @@ PY33 = sys.version_info >= (3, 3)
|
||||||
PY34 = sys.version_info >= (3, 4)
|
PY34 = sys.version_info >= (3, 4)
|
||||||
PY35 = sys.version_info >= (3, 5)
|
PY35 = sys.version_info >= (3, 5)
|
||||||
|
|
||||||
if PY3:
|
str_type = str if PY3 else unicode # NOQA
|
||||||
str_type = str
|
bytes_type = bytes if PY3 else str # NOQA
|
||||||
else:
|
long_type = int if PY3 else long # NOQA
|
||||||
str_type = unicode # NOQA
|
string_types = str if PY3 else basestring # NOQA
|
||||||
|
|
||||||
if PY3:
|
|
||||||
bytes_type = bytes
|
|
||||||
else:
|
|
||||||
bytes_type = str
|
|
||||||
|
|
||||||
if PY3:
|
|
||||||
long_type = int
|
|
||||||
else:
|
|
||||||
long_type = long # NOQA
|
|
||||||
|
|
||||||
if PY3:
|
|
||||||
string_types = str,
|
|
||||||
else:
|
|
||||||
string_types = basestring, # NOQA
|
|
||||||
|
|
||||||
if PY3:
|
if PY3:
|
||||||
exec('def raise_empty(t, *args): raise t(*args) from None')
|
exec('def raise_empty(t, *args): raise t(*args) from None')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user