From: Mukund Sivaraman Date: Mon, 18 Jun 2012 17:50:07 +0000 (+0530) Subject: Revert "[1828] Cleanup code by using with (for accept_sock)" X-Git-Tag: trac2351_base~226^2~39 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=92e3f4158853be65dcc1852fbd3d8443ef5d8613;p=thirdparty%2Fkea.git Revert "[1828] Cleanup code by using with (for accept_sock)" This reverts commit 74b4b2f998f9512b2a326e81062da9099d1eeaf4. --- diff --git a/src/lib/python/isc/util/cio/tests/socketsession_test.py b/src/lib/python/isc/util/cio/tests/socketsession_test.py index f97ded17d0..d492f6d904 100644 --- a/src/lib/python/isc/util/cio/tests/socketsession_test.py +++ b/src/lib/python/isc/util/cio/tests/socketsession_test.py @@ -244,10 +244,11 @@ class TestForwarder(unittest.TestCase): s = socket.socket(socket.AF_UNIX, SOCK_STREAM, 0) s.setblocking(False) s.connect(TEST_UNIX_FILE) - with self.accept_forwarder() as accept_sock: - receiver = SocketSessionReceiver(accept_sock) - s.close() - self.assertRaises(SocketSessionError, receiver.pop) + accept_sock = self.accept_forwarder() + receiver = SocketSessionReceiver(accept_sock) + s.close() + self.assertRaises(SocketSessionError, receiver.pop) + accept_sock.close() class TestReceiver(unittest.TestCase): # We only check a couple of failure cases on construction. Valid cases