Use new form of with-statement instead of contextlib.nested().

This commit is contained in:
Raymond Hettinger 2009-06-04 00:11:54 +00:00
parent a678d94d58
commit 686057b8fa
4 changed files with 11 additions and 12 deletions

View file

@ -174,7 +174,9 @@ class OtherNetworkTests(unittest.TestCase):
(expected_err, url, req, type(err), err))
self.assert_(isinstance(err, expected_err), msg)
else:
with support.transient_internet():
with support.time_out, \
support.socket_peer_reset, \
support.ioerror_peer_reset:
buf = f.read()
f.close()
debug("read %d bytes" % len(buf))