From: Victor Stinner Date: Mon, 11 Sep 2017 22:31:16 +0000 (-0700) Subject: bpo-17085: test_socket: cancel scheduled alarm on test failure (#3505) X-Git-Tag: v2.7.15rc1~204 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=40996d3f6fbd1adcb2e69e426fa311aaf90762ff;p=python bpo-17085: test_socket: cancel scheduled alarm on test failure (#3505) (cherry picked from commit 71fe8c00f6e2eda39d90c225c5f7635268cc4653) --- diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 2b20a79150..bef1872822 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -733,6 +733,7 @@ class GeneralModuleTests(unittest.TestCase): self.assertRaises(socket.timeout, c.sendall, b"x" * test_support.SOCK_MAX_SIZE) finally: + signal.alarm(0) signal.signal(signal.SIGALRM, old_alarm) c.close() s.close()