diff options
author | Richard Oudkerk <shibturn@gmail.com> | 2013-01-13 22:46:48 (GMT) |
---|---|---|
committer | Richard Oudkerk <shibturn@gmail.com> | 2013-01-13 22:46:48 (GMT) |
commit | ed9e06cb21c4437aa87bb23c6509d3dd3274d0fc (patch) | |
tree | f9883ce2f4a7dd0e937b5a7c2160cb57e9d185ac /Lib | |
parent | f1b045f41740b1e25ecb5fc4f75003fac59c118a (diff) | |
download | cpython-ed9e06cb21c4437aa87bb23c6509d3dd3274d0fc.zip cpython-ed9e06cb21c4437aa87bb23c6509d3dd3274d0fc.tar.gz cpython-ed9e06cb21c4437aa87bb23c6509d3dd3274d0fc.tar.bz2 |
Issue #16955: Fix the poll() method for multiprocessing's socket
connections on Windows.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/multiprocessing/connection.py | 2 | ||||
-rw-r--r-- | Lib/test/test_multiprocessing.py | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/Lib/multiprocessing/connection.py b/Lib/multiprocessing/connection.py index 2ae8a81..25b0326 100644 --- a/Lib/multiprocessing/connection.py +++ b/Lib/multiprocessing/connection.py @@ -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) diff --git a/Lib/test/test_multiprocessing.py b/Lib/test/test_multiprocessing.py index 533dbac..bb09638 100644 --- a/Lib/test/test_multiprocessing.py +++ b/Lib/test/test_multiprocessing.py @@ -2383,6 +2383,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') |