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
a06e2ff4
Commit
a06e2ff4
authored
Mar 22, 2016
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ignore interrupted syscalls
parent
a139200c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
gevent/select.py
gevent/select.py
+12
-2
No files found.
gevent/select.py
View file @
a06e2ff4
...
...
@@ -13,6 +13,7 @@ from gevent._compat import itervalues
from
gevent._util
import
copy_globals
from
gevent._util
import
_NONE
from
errno
import
EINTR
from
select
import
select
as
_original_select
try
:
...
...
@@ -118,15 +119,24 @@ def select(rlist, wlist, xlist, timeout=None): # pylint:disable=unused-argument
# raises a ValueError (which makes sense). Older pythons raise
# the error from the select syscall...but we don't actually get there.
# We choose to just raise the ValueError as it makes more sense and is
# forward compatible
(plus we don't have to import errno)
# forward compatible
raise
ValueError
(
"timeout must be non-negative"
)
# First, do a poll with the original select system call. This
# is the most efficient way to check to see if any of the file descriptors
# have previously been closed and raise the correct corresponding exception.
# (Because libev tends to just return them as ready...)
# We accept the *xlist* here even though we can't below because this is all about
# error handling.
sel_results
=
_original_select
(
rlist
,
wlist
,
xlist
,
0
)
try
:
sel_results
=
_original_select
(
rlist
,
wlist
,
xlist
,
0
)
except
error
as
e
:
enumber
=
getattr
(
e
,
'errno'
,
None
)
or
e
.
args
[
0
]
if
enumber
!=
EINTR
:
# Ignore interrupted syscalls
raise
sel_results
=
((),
(),
())
if
sel_results
[
0
]
or
sel_results
[
1
]
or
sel_results
[
2
]:
# If we actually had stuff ready, go ahead and return it. No need
# to go through the trouble of doing our own stuff.
...
...
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