mirror of https://github.com/python/cpython
Issue #16955: Fix the poll() method for multiprocessing's socket
connections on Windows.
This commit is contained in:
commit
0ee84e04da
|
@ -405,7 +405,7 @@ class Connection(_ConnectionBase):
|
|||
return self._recv(size)
|
||||
|
||||
def _poll(self, timeout):
|
||||
r = wait([self._handle], timeout)
|
||||
r = wait([self], timeout)
|
||||
return bool(r)
|
||||
|
||||
|
||||
|
|
|
@ -2358,6 +2358,17 @@ class _TestListenerClient(BaseTestCase):
|
|||
p.join()
|
||||
l.close()
|
||||
|
||||
def test_issue16955(self):
|
||||
for fam in self.connection.families:
|
||||
l = self.connection.Listener(family=fam)
|
||||
c = self.connection.Client(l.address)
|
||||
a = l.accept()
|
||||
a.send_bytes(b"hello")
|
||||
self.assertTrue(c.poll(1))
|
||||
a.close()
|
||||
c.close()
|
||||
l.close()
|
||||
|
||||
class _TestPoll(unittest.TestCase):
|
||||
|
||||
ALLOWED_TYPES = ('processes', 'threads')
|
||||
|
|
|
@ -217,6 +217,9 @@ Core and Builtins
|
|||
Library
|
||||
-------
|
||||
|
||||
- Issue #16955: Fix the poll() method for multiprocessing's socket
|
||||
connections on Windows.
|
||||
|
||||
- SSLContext.load_dh_params() now properly closes the input file.
|
||||
|
||||
- Issue #16829: IDLE printing no longer fails if there are spaces or other
|
||||
|
|
Loading…
Reference in New Issue