summaryrefslogtreecommitdiffstats
path: root/Lib/test/subprocessdata/sigchild_ignore.py
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2010-12-14 15:02:53 (GMT)
committerGregory P. Smith <greg@mad-scientist.com>2010-12-14 15:02:53 (GMT)
commit312efbc1158a15cb877d8bb078c19f95b23596e6 (patch)
tree199100b59037b96fa0b74b74c378f5edac8bb895 /Lib/test/subprocessdata/sigchild_ignore.py
parentdacb8043ff1fb6fa33b5457f0405a1ca867ba2d3 (diff)
downloadcpython-312efbc1158a15cb877d8bb078c19f95b23596e6.zip
cpython-312efbc1158a15cb877d8bb078c19f95b23596e6.tar.gz
cpython-312efbc1158a15cb877d8bb078c19f95b23596e6.tar.bz2
Merged revisions 87233 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r87233 | gregory.p.smith | 2010-12-14 06:38:00 -0800 (Tue, 14 Dec 2010) | 4 lines Issue #1731717: Fixed the problem where subprocess.wait() could cause an OSError exception when The OS had been told to ignore SIGCLD in our process or otherwise not wait for exiting child processes. ........
Diffstat (limited to 'Lib/test/subprocessdata/sigchild_ignore.py')
-rw-r--r--Lib/test/subprocessdata/sigchild_ignore.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/subprocessdata/sigchild_ignore.py b/Lib/test/subprocessdata/sigchild_ignore.py
new file mode 100644
index 0000000..1d03303
--- /dev/null
+++ b/Lib/test/subprocessdata/sigchild_ignore.py
@@ -0,0 +1,6 @@
+import signal, subprocess, sys
+# On Linux this causes os.waitpid to fail with OSError as the OS has already
+# reaped our child process. The wait() passing the OSError on to the caller
+# and causing us to exit with an error is what we are testing against.
+signal.signal(signal.SIGCLD, signal.SIG_IGN)
+subprocess.Popen([sys.executable, '-c', 'print("albatross")']).wait()