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
b699b1fa
Commit
b699b1fa
authored
Jun 21, 2010
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: do not lose reference if event_add failed
parent
6f4ab506
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
gevent/core.pyx
gevent/core.pyx
+3
-2
No files found.
gevent/core.pyx
View file @
b699b1fa
...
...
@@ -264,8 +264,7 @@ cdef class event:
cdef
timeval
tv
cdef
double
c_timeout
cdef
int
result
if
not
event_pending
(
&
self
.
ev
,
EV_READ
|
EV_WRITE
|
EV_SIGNAL
|
EV_TIMEOUT
,
NULL
):
Py_INCREF
(
self
)
cdef
int
need_incref
=
not
event_pending
(
&
self
.
ev
,
EV_READ
|
EV_WRITE
|
EV_SIGNAL
|
EV_TIMEOUT
,
NULL
)
errno
=
0
# event_add sometime does not set errno
if
timeout
>=
0.0
:
c_timeout
=
<
double
>
timeout
...
...
@@ -279,6 +278,8 @@ cdef class event:
raise
IOError
(
errno
,
strerror
(
errno
))
else
:
raise
IOError
(
"event_add(fileno=%s) returned %s"
%
(
self
.
fd
,
result
))
if
need_incref
:
Py_INCREF
(
self
)
def
cancel
(
self
):
"""Remove event from the event queue."""
...
...
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