Commit 07891830 authored by Jason Madden's avatar Jason Madden

More Python 3.8 fixes, and another attempt at the PyPy fix.

parent 2ef0a109
......@@ -29,8 +29,8 @@ else
# and it's pretty large.
# So if we need to incorporate changes from pyenv, either temporarily
# turn this back on, or remove the Travis caches.
git fetch || echo "Fetch failed to complete. Ignoring"
git reset --hard origin/master
# git fetch || echo "Fetch failed to complete. Ignoring"
# git reset --hard origin/master
cd $back
fi
......
......@@ -162,7 +162,7 @@ class SSLContext(orig_SSLContext):
super(orig_SSLContext, orig_SSLContext).sni_callback.__set__(self, value)
else:
# In newer versions, this just sets sni_callback.
def set_servername_callback(self, cb):
def set_servername_callback(self, cb): # pylint:disable=arguments-differ
if cb and callable(cb):
cb = _Callback(cb)
super().set_servername_callback(cb)
......
......@@ -1007,10 +1007,15 @@ class Popen(object):
# Process startup details
if startupinfo is None:
startupinfo = STARTUPINFO()
elif hasattr(startupinfo, '_copy'):
elif hasattr(startupinfo, 'copy'):
# bpo-34044: Copy STARTUPINFO since it is modified below,
# so the caller can reuse it multiple times.
startupinfo = startupinfo.copy()
elif hasattr(startupinfo, '_copy'):
# When the fix was backported to Python 3.7, copy() was
# made private as _copy.
startupinfo = startupinfo._copy()
use_std_handles = -1 not in (p2cread, c2pwrite, errwrite)
if use_std_handles:
startupinfo.dwFlags |= STARTF_USESTDHANDLES
......
This diff is collapsed.
......@@ -16,6 +16,11 @@ def handle(*_args):
os.waitpid(-1, os.WNOHANG)
# The signal watcher must be installed *before* monkey patching
if hasattr(signal, 'SIGCHLD'):
if sys.version_info[:2] >= (3, 8) and os.environ.get("PYTHONDEVMODE"):
# See test__monkey_sigchld.py
print("Ran 1 tests in 0.0s (skipped=1)")
sys.exit(0)
# On Python 2, the signal handler breaks the platform
# module, because it uses os.popen. pkg_resources uses the platform
# module.
......
......@@ -25,6 +25,11 @@ def _waitpid(p):
assert stat == 0, stat
if hasattr(signal, 'SIGCHLD'):
if sys.version_info[:2] >= (3, 8) and os.environ.get("PYTHONDEVMODE"):
# See test__monkey_sigchld.py
print("Ran 1 tests in 0.0s (skipped=1)")
sys.exit(0)
# Do what subprocess does and make sure we have the watcher
# in the parent
get_hub().loop.install_sigchld()
......@@ -50,3 +55,4 @@ if hasattr(signal, 'SIGCHLD'):
sys.exit(0)
else:
print("No SIGCHLD, not testing")
print("Ran 1 tests in 0.0s (skipped=1)")
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