]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-31479: Always reset the signal alarm in tests (GH-3588) (GH-7314)
authorVictor Stinner <vstinner@redhat.com>
Fri, 1 Jun 2018 13:23:02 +0000 (15:23 +0200)
committerGitHub <noreply@github.com>
Fri, 1 Jun 2018 13:23:02 +0000 (15:23 +0200)
commit3604b2390a8986117c35d661d3d3a5977dfe8260
treea011bd0dcf7cb41645eb404eb67ef8a6db44bc6f
parent0f642620a8a85ef0b5482f253205baf1865e05b2
bpo-31479: Always reset the signal alarm in tests (GH-3588) (GH-7314)

* 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/test_io.py
Lib/test/test_pty.py
Lib/test/test_signal.py
Lib/test/test_socket.py
Lib/test/test_socketserver.py
Lib/test/test_subprocess.py
Lib/test/test_threadsignals.py