summaryrefslogtreecommitdiffstats
path: root/Lib/test/_test_multiprocessing.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-09-29 00:41:12 (GMT)
committerGitHub <noreply@github.com>2023-09-29 00:41:12 (GMT)
commitbd4518c60c9df356cf5e05b81305e3644ebb5e70 (patch)
tree398e3176f6029b0a6253b0b3ec988982a6046d2c /Lib/test/_test_multiprocessing.py
parent4e356ad183eeb567783f4a87fd092573da1e9252 (diff)
downloadcpython-bd4518c60c9df356cf5e05b81305e3644ebb5e70.zip
cpython-bd4518c60c9df356cf5e05b81305e3644ebb5e70.tar.gz
cpython-bd4518c60c9df356cf5e05b81305e3644ebb5e70.tar.bz2
gh-110036: multiprocessing Popen.terminate() catches PermissionError (#110037)
On Windows, multiprocessing Popen.terminate() now catchs PermissionError and get the process exit code. If the process is still running, raise again the PermissionError. Otherwise, the process terminated as expected: store its exit code.
Diffstat (limited to 'Lib/test/_test_multiprocessing.py')
-rw-r--r--Lib/test/_test_multiprocessing.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
index 756d680..39666dd 100644
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -557,13 +557,14 @@ class _TestProcess(BaseTestCase):
def test_terminate(self):
exitcode = self._kill_process(multiprocessing.Process.terminate)
- if os.name != 'nt':
- self.assertEqual(exitcode, -signal.SIGTERM)
+ self.assertEqual(exitcode, -signal.SIGTERM)
def test_kill(self):
exitcode = self._kill_process(multiprocessing.Process.kill)
if os.name != 'nt':
self.assertEqual(exitcode, -signal.SIGKILL)
+ else:
+ self.assertEqual(exitcode, -signal.SIGTERM)
def test_cpu_count(self):
try: