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
05fdc001
Commit
05fdc001
authored
Aug 29, 2011
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hub: do not catch the error in switch_out(). Use switch_out to prevent Hub to Hub switch
parent
7f5a562b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
gevent/hub.py
gevent/hub.py
+5
-7
No files found.
gevent/hub.py
View file @
05fdc001
...
...
@@ -277,21 +277,19 @@ class Hub(greenlet):
sys
.
stderr
.
write
(
'%s failed with %s
\
n
\
n
'
%
(
context
,
getattr
(
type
,
'__name__'
,
'exception'
),
))
def
switch
(
self
):
cur
=
getcurrent
()
assert
cur
is
not
self
,
'Impossible to call blocking function in the event loop callback'
exc_type
,
exc_value
=
sys
.
exc_info
()[:
2
]
try
:
switch_out
=
getattr
(
cur
,
'switch_out'
,
None
)
switch_out
=
getattr
(
getcurrent
()
,
'switch_out'
,
None
)
if
switch_out
is
not
None
:
try
:
switch_out
()
except
:
self
.
handle_error
(
switch_out
,
*
sys
.
exc_info
())
switch_out
()
exc_clear
()
return
greenlet
.
switch
(
self
)
finally
:
core
.
set_exc_info
(
exc_type
,
exc_value
)
def
switch_out
(
self
):
raise
AssertionError
(
'Impossible to call blocking function in the event loop callback'
)
def
wait
(
self
,
watcher
):
unique
=
object
()
watcher
.
start
(
getcurrent
().
switch
,
unique
)
...
...
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