Commit b300d39c authored by Denis Bilenko's avatar Denis Bilenko

core.pyx: fix OverlowError

parent cd86f529
......@@ -192,15 +192,14 @@ cdef class event:
def __get__(self):
result = []
cdef short events = self.ev.ev_events
cdef short c_event
cdef int events = self.ev.ev_events
cdef int c_event
for (event, txt) in ((EV_TIMEOUT, 'TIMEOUT'), (EV_READ, 'READ'), (EV_WRITE, 'WRITE'),
(EV_SIGNAL, 'SIGNAL'), (EV_PERSIST, 'PERSIST')):
c_event = event
if events & c_event:
result.append(txt)
c_event = c_event ^ 0xffffff
events = events & c_event
events = events & (~c_event)
if events:
result.append(hex(events))
return '|'.join(result)
......@@ -221,8 +220,7 @@ cdef class event:
c_flag = flag
if flags & c_flag:
result.append(txt)
c_flag = c_flag ^ 0xffffffff
flags = flags & c_flag
flags = flags & (~c_flag)
if flags:
result.append(hex(flags))
return '|'.join(result)
......
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