]> granicus.if.org Git - python/commitdiff
bpo-17085: test_socket: cancel scheduled alarm on test failure (#3505)
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 11 Sep 2017 22:31:16 +0000 (15:31 -0700)
committerGitHub <noreply@github.com>
Mon, 11 Sep 2017 22:31:16 +0000 (15:31 -0700)
(cherry picked from commit 71fe8c00f6e2eda39d90c225c5f7635268cc4653)

Lib/test/test_socket.py

index 2b20a791501ff1e172c5c4951264f71c319f2cd2..bef1872822623788f97a81b379110bab31416e9d 100644 (file)
@@ -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()