Commit 57193b47 authored by Denis Bilenko's avatar Denis Bilenko

avoid Python name lookups when accessing EV_* constants from Cython code....

avoid Python name lookups when accessing EV_* constants from Cython code. Patch by Daniele Varrazzo.
parent c57798fc
......@@ -29,6 +29,13 @@ __all__ = ['Greenlet',
'reinit']
from gevent import core
core.EV_TIMEOUT = 0x01
core.EV_READ = 0x02
core.EV_WRITE = 0x04
core.EV_SIGNAL = 0x08
core.EV_PERSIST = 0x10
from gevent.core import reinit
from gevent.greenlet import Greenlet, joinall, killall
spawn = Greenlet.spawn
......
......@@ -93,6 +93,12 @@ cdef extern from "libevent.h":
int EVLOOP_NONBLOCK
char* _EVENT_VERSION
int EV_TIMEOUT
int EV_READ
int EV_WRITE
int EV_SIGNAL
int EV_PERSIST
cdef extern from "string.h":
char* strerror(int errnum)
......@@ -123,12 +129,6 @@ cdef extern from "libevent.h":
event_base* current_base
EV_TIMEOUT = 0x01
EV_READ = 0x02
EV_WRITE = 0x04
EV_SIGNAL = 0x08
EV_PERSIST = 0x10
cdef void __event_handler(int fd, short evtype, void *arg) with gil:
cdef event ev = <event>arg
try:
......
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