Issue #11743: Rewrite multiprocessing connection classes in pure Python.

This commit is contained in:
Antoine Pitrou 2011-05-09 17:04:27 +02:00
parent df77e3d4a0
commit 87cf220972
15 changed files with 490 additions and 983 deletions

View file

@ -1915,9 +1915,15 @@ class TestInvalidHandle(unittest.TestCase):
@unittest.skipIf(WIN32, "skipped on Windows")
def test_invalid_handles(self):
conn = _multiprocessing.Connection(44977608)
self.assertRaises(IOError, conn.poll)
self.assertRaises(IOError, _multiprocessing.Connection, -1)
conn = multiprocessing.connection.Connection(44977608)
try:
self.assertRaises((ValueError, IOError), conn.poll)
finally:
# Hack private attribute _handle to avoid printing an error
# in conn.__del__
conn._handle = None
self.assertRaises((ValueError, IOError),
multiprocessing.connection.Connection, -1)
#
# Functions used to create test cases from the base ones in this module