mirror of https://github.com/python/cpython
test_socket: cancel scheduled alarm on test failure
This commit is contained in:
parent
9e0ae53980
commit
71fe8c00f6
|
@ -1216,6 +1216,7 @@ class GeneralModuleTests(unittest.TestCase):
|
||||||
signal.alarm(1)
|
signal.alarm(1)
|
||||||
self.assertRaises(socket.timeout, c.sendall, b"x" * (1024**2))
|
self.assertRaises(socket.timeout, c.sendall, b"x" * (1024**2))
|
||||||
finally:
|
finally:
|
||||||
|
signal.alarm(0)
|
||||||
signal.signal(signal.SIGALRM, old_alarm)
|
signal.signal(signal.SIGALRM, old_alarm)
|
||||||
c.close()
|
c.close()
|
||||||
s.close()
|
s.close()
|
||||||
|
|
Loading…
Reference in New Issue