summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_subprocess.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-06-14 17:31:43 (GMT)
committerGitHub <noreply@github.com>2019-06-14 17:31:43 (GMT)
commit5884043252473ac733aba1d3251d4debe72511e5 (patch)
treebf35f78fa4c7d201b0d1956156907a706bd095d8 /Lib/test/test_subprocess.py
parent066e5b1a917ec2134e8997d2cadd815724314252 (diff)
downloadcpython-5884043252473ac733aba1d3251d4debe72511e5.zip
cpython-5884043252473ac733aba1d3251d4debe72511e5.tar.gz
cpython-5884043252473ac733aba1d3251d4debe72511e5.tar.bz2
bpo-35537: Rewrite setsid test for os.posix_spawn (GH-11721)
bpo-35537, bpo-35876: Fix also test_start_new_session() of test_subprocess: use os.getsid() rather than os.getpgid().
Diffstat (limited to 'Lib/test/test_subprocess.py')
-rw-r--r--Lib/test/test_subprocess.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index fca3ed6..97d2190 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -1705,16 +1705,15 @@ class POSIXProcessTestCase(BaseTestCase):
# still indicates that it was called.
try:
output = subprocess.check_output(
- [sys.executable, "-c",
- "import os; print(os.getpgid(os.getpid()))"],
+ [sys.executable, "-c", "import os; print(os.getsid(0))"],
start_new_session=True)
except OSError as e:
if e.errno != errno.EPERM:
raise
else:
- parent_pgid = os.getpgid(os.getpid())
- child_pgid = int(output)
- self.assertNotEqual(parent_pgid, child_pgid)
+ parent_sid = os.getsid(0)
+ child_sid = int(output)
+ self.assertNotEqual(parent_sid, child_sid)
def test_run_abort(self):
# returncode handles signal termination