Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
238ca31e
Commit
238ca31e
authored
Dec 28, 2011
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: add set_syserr_cb() function
parent
2bcc11ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
gevent/core.ppyx
gevent/core.ppyx
+24
-0
No files found.
gevent/core.ppyx
View file @
238ca31e
...
...
@@ -30,6 +30,7 @@ cdef extern from *:
int FD_SETSIZE
int ioctlsocket(int, int, unsigned long*)
int FIONREAD
int errno
UNDEF = libev.EV_UNDEF
...
...
@@ -735,6 +736,29 @@ cdef public class callback(watcher) [object PyGeventCallbackObject, type PyGeven
return self.callback is not None
__SYSERR_CALLBACK = None
cdef void _syserr_cb(char* msg) with gil:
try:
__SYSERR_CALLBACK(msg, errno)
except:
set_syserr_cb(None)
raise
def set_syserr_cb(callback):
global __SYSERR_CALLBACK
if callback is None:
libev.ev_set_syserr_cb(NULL)
__SYSERR_CALLBACK = None
elif hasattr(callback, '__call__'):
libev.ev_set_syserr_cb(<void *>_syserr_cb)
__SYSERR_CALLBACK = callback
else:
raise TypeError('Expected callable or None, got %r' % (callback, ))
def set_exc_info(object type, object value):
cdef PyThreadState* tstate = PyThreadState_GET()
Py_XDECREF(tstate.exc_type)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment