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
175ebc10
Commit
175ebc10
authored
Nov 22, 2010
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not save traceback object in Hub.switch() as that can leak it; only save an exception object
parent
477e7ca2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
10 deletions
+14
-10
gevent/core.pyx
gevent/core.pyx
+12
-8
gevent/hub.py
gevent/hub.py
+2
-2
No files found.
gevent/core.pyx
View file @
175ebc10
...
...
@@ -584,7 +584,8 @@ def get_header_version():
return
levent
.
_EVENT_VERSION
def
set_exc_info
(
object
typ
,
object
value
,
object
tb
):
def
set_exc_info
(
object
value
):
cdef
object
typ
cdef
PyThreadState
*
tstate
=
PyThreadState_GET
()
if
tstate
.
exc_type
!=
NULL
:
Py_DECREF
(
<
object
>
tstate
.
exc_type
)
...
...
@@ -592,13 +593,16 @@ def set_exc_info(object typ, object value, object tb):
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
if
value
is
None
:
tstate
.
exc_type
=
NULL
tstate
.
exc_value
=
NULL
else
:
typ
=
type
(
value
)
Py_INCREF
(
typ
)
Py_INCREF
(
value
)
tstate
.
exc_type
=
<
void
*>
typ
tstate
.
exc_value
=
<
void
*>
value
tstate
.
exc_traceback
=
NULL
#include "evdns.pxi"
include
"evbuffer.pxi"
...
...
gevent/hub.py
View file @
175ebc10
...
...
@@ -169,7 +169,7 @@ class Hub(greenlet):
def
switch
(
self
):
cur
=
getcurrent
()
assert
cur
is
not
self
,
'Impossible to call blocking function in the event loop callback'
exc
_info
=
sys
.
exc_info
()
exc
eption
=
sys
.
exc_info
()[
1
]
try
:
switch_out
=
getattr
(
cur
,
'switch_out'
,
None
)
if
switch_out
is
not
None
:
...
...
@@ -180,7 +180,7 @@ class Hub(greenlet):
sys
.
exc_clear
()
return
greenlet
.
switch
(
self
)
finally
:
core
.
set_exc_info
(
*
exc_info
)
core
.
set_exc_info
(
exception
)
def
run
(
self
):
global
_threadlocal
...
...
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