Commit 0ebe9d1e authored by Jason Madden's avatar Jason Madden

Skip sigchld test on windows [skip ci]

parent 20cd54fc
...@@ -15,28 +15,31 @@ def handle(*args): ...@@ -15,28 +15,31 @@ def handle(*args):
# This is the opposite of gunicorn. # This is the opposite of gunicorn.
os.waitpid(-1, os.WNOHANG) os.waitpid(-1, os.WNOHANG)
# The signal watcher must be installed *before* monkey patching # The signal watcher must be installed *before* monkey patching
signal.signal(signal.SIGCHLD, handle) if hasattr(signal, 'SIGCHLD'):
signal.signal(signal.SIGCHLD, handle)
pid = os.fork() pid = os.fork()
if pid: # parent if pid: # parent
try: try:
_, stat = os.waitpid(pid, 0) _, stat = os.waitpid(pid, 0)
except OSError: except OSError:
# Interrupted system call # Interrupted system call
_, stat = os.waitpid(pid, 0) _, stat = os.waitpid(pid, 0)
assert stat == 0, stat assert stat == 0, stat
else: else:
import gevent.monkey import gevent.monkey
gevent.monkey.patch_all() gevent.monkey.patch_all()
signal.signal(signal.SIGCHLD, signal.SIG_DFL) signal.signal(signal.SIGCHLD, signal.SIG_DFL)
# Under Python 2, os.popen() directly uses the popen call, and # Under Python 2, os.popen() directly uses the popen call, and
# popen's file uses the pclose() system call to # popen's file uses the pclose() system call to
# wait for the child. If it's already waited on, # wait for the child. If it's already waited on,
# it raises the same exception. # it raises the same exception.
# Python 3 uses the subprocess module directly which doesn't # Python 3 uses the subprocess module directly which doesn't
# have this problem. # have this problem.
f = os.popen('true') f = os.popen('true')
f.close() f.close()
sys.exit(0) sys.exit(0)
else:
print("No SIGCHLD, not testing")
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment