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
22641c9b
Commit
22641c9b
authored
May 28, 2010
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add core.set_exc_info() function
parent
8cb43bfb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
gevent/core.pyx
gevent/core.pyx
+24
-0
No files found.
gevent/core.pyx
View file @
22641c9b
...
...
@@ -61,6 +61,14 @@ cdef extern from "Python.h":
object
PyString_FromString
(
char
*
v
)
int
PyObject_AsCharBuffer
(
object
obj
,
char
**
buffer
,
int
*
buffer_len
)
cdef
extern
from
"frameobject.h"
:
ctypedef
struct
PyThreadState
:
void
*
exc_type
void
*
exc_value
void
*
exc_traceback
PyThreadState
*
PyThreadState_GET
()
ctypedef
void
(
*
event_handler
)(
int
fd
,
short
evtype
,
void
*
arg
)
...
...
@@ -451,3 +459,19 @@ if get_version() != get_header_version() and get_header_version() is not None:
include
"evbuffer.pxi"
include
"evhttp.pxi"
def
set_exc_info
(
object
typ
,
object
value
,
object
tb
):
cdef
PyThreadState
*
tstate
=
PyThreadState_GET
()
if
tstate
.
exc_type
!=
NULL
:
Py_DECREF
(
<
object
>
tstate
.
exc_type
)
if
tstate
.
exc_value
!=
NULL
:
Py_DECREF
(
<
object
>
tstate
.
exc_value
)
if
tstate
.
exc_traceback
!=
NULL
:
Py_DECREF
(
<
object
>
tstate
.
exc_traceback
)
Py_INCREF
(
typ
)
Py_INCREF
(
value
)
Py_INCREF
(
tb
)
tstate
.
exc_type
=
<
void
*>
typ
tstate
.
exc_value
=
<
void
*>
value
tstate
.
exc_traceback
=
<
void
*>
tb
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