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
eb793145
Commit
eb793145
authored
Jan 10, 2010
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
event: improve readability
parent
140355ba
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
gevent/event.py
gevent/event.py
+11
-10
No files found.
gevent/event.py
View file @
eb793145
...
...
@@ -65,16 +65,16 @@ class Event(object):
switch
=
getcurrent
().
switch
self
.
rawlink
(
switch
)
try
:
t
=
Timeout
.
start_new
(
timeout
)
t
imer
=
Timeout
.
start_new
(
timeout
)
try
:
try
:
result
=
get_hub
().
switch
()
assert
result
is
self
,
'Invalid switch into Event.wait(): %r'
%
(
result
,
)
except
Timeout
,
ex
c
:
if
ex
c
is
not
t
:
except
Timeout
,
ex
:
if
ex
is
not
timer
:
raise
finally
:
t
.
cancel
()
t
imer
.
cancel
()
finally
:
self
.
unlink
(
switch
)
...
...
@@ -160,7 +160,8 @@ class AsyncResult(object):
@
property
def
exception
(
self
):
"Holds the exception instance passed to :meth:`set_exception` if :meth:`set_exception` was called. Otherwise ``None``."
"""Holds the exception instance passed to :meth:`set_exception` if :meth:`set_exception` was called.
Otherwise ``None``."""
if
self
.
_exception
is
not
_NONE
:
return
self
.
_exception
...
...
@@ -204,12 +205,12 @@ class AsyncResult(object):
switch
=
getcurrent
().
switch
self
.
rawlink
(
switch
)
try
:
t
=
Timeout
.
start_new
(
timeout
)
t
imer
=
Timeout
.
start_new
(
timeout
)
try
:
result
=
get_hub
().
switch
()
assert
result
is
self
,
'Invalid switch into AsyncResult.get(): %r'
%
(
result
,
)
finally
:
t
.
cancel
()
t
imer
.
cancel
()
except
:
self
.
unlink
(
switch
)
raise
...
...
@@ -247,15 +248,15 @@ class AsyncResult(object):
switch
=
getcurrent
().
switch
self
.
rawlink
(
switch
)
try
:
t
=
Timeout
.
start_new
(
timeout
)
t
imer
=
Timeout
.
start_new
(
timeout
)
try
:
result
=
get_hub
().
switch
()
assert
result
is
self
,
'Invalid switch into AsyncResult.wait(): %r'
%
(
result
,
)
finally
:
t
.
cancel
()
t
imer
.
cancel
()
except
Timeout
,
exc
:
self
.
unlink
(
switch
)
if
exc
is
not
t
:
if
exc
is
not
t
imer
:
raise
except
:
self
.
unlink
(
switch
)
...
...
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