summaryrefslogtreecommitdiffstats
path: root/Lib/test/signalinterproctester.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/signalinterproctester.py')
-rw-r--r--Lib/test/signalinterproctester.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/signalinterproctester.py b/Lib/test/signalinterproctester.py
index cdcd92a..073c078 100644
--- a/Lib/test/signalinterproctester.py
+++ b/Lib/test/signalinterproctester.py
@@ -1,3 +1,4 @@
+import gc
import os
import signal
import subprocess
@@ -59,6 +60,13 @@ class InterProcessSignalTests(unittest.TestCase):
self.assertEqual(self.got_signals, {'SIGHUP': 1, 'SIGUSR1': 0,
'SIGALRM': 0})
+ # gh-110033: Make sure that the subprocess.Popen is deleted before
+ # the next test which raises an exception. Otherwise, the exception
+ # may be raised when Popen.__del__() is executed and so be logged
+ # as "Exception ignored in: <function Popen.__del__ at ...>".
+ child = None
+ gc.collect()
+
with self.assertRaises(SIGUSR1Exception):
with self.subprocess_send_signal(pid, "SIGUSR1") as child:
self.wait_signal(child, 'SIGUSR1')