Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
c179a55a
Commit
c179a55a
authored
Jan 21, 2014
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
selectors: add a comment to explain why and how poll timeout is rounded
parent
850f313d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
Lib/selectors.py
Lib/selectors.py
+4
-2
No files found.
Lib/selectors.py
View file @
c179a55a
...
...
@@ -354,10 +354,12 @@ if hasattr(select, 'poll'):
def
select
(
self
,
timeout
=
None
):
if
timeout
is
None
:
timeout
=
None
elif
timeout
<
0
:
elif
timeout
<
=
0
:
timeout
=
0
else
:
timeout
=
int
(
math
.
ceil
(
timeout
*
1000.0
))
# poll() has a resolution of 1 millisecond, round away from
# zero to wait *at least* timeout seconds.
timeout
=
int
(
math
.
ceil
(
timeout
*
1e3
))
ready
=
[]
try
:
fd_event_list
=
self
.
_poll
.
poll
(
timeout
)
...
...
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