Commit e01d944a authored by Denis Bilenko's avatar Denis Bilenko

core.ppyx: use integer_types

parent 4669715e
......@@ -17,6 +17,13 @@ __all__ = ['get_version',
'time',
'loop']
cdef tuple integer_types
if sys.version_info[0] >= 3:
integer_types = int,
else:
integer_types = (int, long)
cdef extern from "callbacks.h":
void gevent_callback_io(libev.ev_loop, void*, int)
......@@ -151,7 +158,7 @@ cpdef unsigned int _flags_to_int(object flags) except? -1:
# Note, that order does not matter, libev has its own predefined order
if not flags:
return 0
if isinstance(flags, (int, long)):
if isinstance(flags, integer_types):
return flags
cdef unsigned int result = 0
try:
......@@ -167,7 +174,7 @@ cpdef unsigned int _flags_to_int(object flags) except? -1:
cdef str _str_hex(object flag):
if isinstance(flag, (int, long)):
if isinstance(flag, integer_types):
return hex(flag)
return str(flag)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment