]> granicus.if.org Git - python/commit
bpo-31479: Always reset the signal alarm in tests (GH-3588) (GH-7312)
authorVictor Stinner <vstinner@redhat.com>
Fri, 1 Jun 2018 13:23:10 +0000 (15:23 +0200)
committerGitHub <noreply@github.com>
Fri, 1 Jun 2018 13:23:10 +0000 (15:23 +0200)
commit95681c7a7ddd436ba7d6c10d1202c33dd6bd648b
tree09d65225dac18d9be9dc0eb71cc8fca13c68f361
parent8f7bd307ce54570275700523532c1e098ce67b60
bpo-31479: Always reset the signal alarm in tests (GH-3588) (GH-7312)

* bpo-31479: Always reset the signal alarm in tests

Use "try: ... finally: signal.signal(0)" pattern to make sure that
tests don't "leak" a pending fatal signal alarm.

* Move two more alarm() calls into the try block

Fix also typo: replace signal.signal(0) with signal.alarm(0)

* Move another signal.alarm() into the try block

(cherry picked from commit 9abee722d448c1c00c7d4e11ce242ec7b13e5c49)
Lib/test/signalinterproctester.py
Lib/test/test_io.py
Lib/test/test_pty.py
Lib/test/test_selectors.py
Lib/test/test_socket.py
Lib/test/test_threadsignals.py