mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
bpo-31334: Fix timeout in select.poll.poll() (GH-3277)
Always pass -1, or INFTIM where defined, to the poll() system call when a negative timeout is passed to the poll.poll([timeout]) method in the select module. Various OSes throw an error with arbitrary negative values.
This commit is contained in:
parent
2c15b29aea
commit
6cfa927ceb
4 changed files with 21 additions and 10 deletions
|
|
@ -207,7 +207,7 @@ class PollTests(unittest.TestCase):
|
|||
@unittest.skipUnless(threading, 'Threading required for this test.')
|
||||
@reap_threads
|
||||
def test_poll_blocks_with_negative_ms(self):
|
||||
for timeout_ms in [None, -1, -1.0, -0.1, -1e-100]:
|
||||
for timeout_ms in [None, -1000, -1, -1.0, -0.1, -1e-100]:
|
||||
# Create two file descriptors. This will be used to unlock
|
||||
# the blocking call to poll.poll inside the thread
|
||||
r, w = os.pipe()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue