mirror of
https://github.com/python/cpython
synced 2024-09-16 00:17:02 +00:00
bpo-45873: Restore Python 3.6 compatibility (GH-29730)
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
This commit is contained in:
parent
4ae26b9c1d
commit
f840398a5f
|
@ -5,8 +5,10 @@
|
||||||
import contextlib
|
import contextlib
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
import sys
|
||||||
import time
|
import time
|
||||||
import types
|
import types
|
||||||
|
import unicodedata
|
||||||
from typing import Dict, FrozenSet, Tuple, TextIO
|
from typing import Dict, FrozenSet, Tuple, TextIO
|
||||||
|
|
||||||
import umarshal
|
import umarshal
|
||||||
|
@ -14,9 +16,13 @@
|
||||||
verbose = False
|
verbose = False
|
||||||
|
|
||||||
|
|
||||||
|
def isprintable(b: bytes) -> bool:
|
||||||
|
return all(0x20 <= c < 0x7f for c in b)
|
||||||
|
|
||||||
|
|
||||||
def make_string_literal(b: bytes) -> str:
|
def make_string_literal(b: bytes) -> str:
|
||||||
res = ['"']
|
res = ['"']
|
||||||
if b.isascii() and b.decode("ascii").isprintable():
|
if isprintable(b):
|
||||||
res.append(b.decode("ascii").replace("\\", "\\\\").replace("\"", "\\\""))
|
res.append(b.decode("ascii").replace("\\", "\\\\").replace("\"", "\\\""))
|
||||||
else:
|
else:
|
||||||
for i in b:
|
for i in b:
|
||||||
|
|
12
configure
vendored
12
configure
vendored
|
@ -3142,7 +3142,7 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
|
||||||
# pybuilddir.txt will be created by --generate-posix-vars in the Makefile
|
# pybuilddir.txt will be created by --generate-posix-vars in the Makefile
|
||||||
rm -f pybuilddir.txt
|
rm -f pybuilddir.txt
|
||||||
|
|
||||||
for ac_prog in python$PACKAGE_VERSION python3 python
|
for ac_prog in python$PACKAGE_VERSION python3.10 python3.9 python3.8 python3.7 python3.6 python3 python
|
||||||
do
|
do
|
||||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||||
set dummy $ac_prog; ac_word=$2
|
set dummy $ac_prog; ac_word=$2
|
||||||
|
@ -3187,6 +3187,16 @@ test -n "$PYTHON_FOR_REGEN" || PYTHON_FOR_REGEN="python3"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Python for regen version" >&5
|
||||||
|
$as_echo_n "checking Python for regen version... " >&6; }
|
||||||
|
if command -v $PYTHON_FOR_REGEN >/dev/null 2>&1; then
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $($PYTHON_FOR_REGEN -V 2>/dev/null)" >&5
|
||||||
|
$as_echo "$($PYTHON_FOR_REGEN -V 2>/dev/null)" >&6; }
|
||||||
|
else
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: missing" >&5
|
||||||
|
$as_echo "missing" >&6; }
|
||||||
|
fi
|
||||||
|
|
||||||
if test "$cross_compiling" = yes; then
|
if test "$cross_compiling" = yes; then
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for python interpreter for cross build" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for python interpreter for cross build" >&5
|
||||||
$as_echo_n "checking for python interpreter for cross build... " >&6; }
|
$as_echo_n "checking for python interpreter for cross build... " >&6; }
|
||||||
|
|
11
configure.ac
11
configure.ac
|
@ -96,9 +96,18 @@ AC_SUBST(host)
|
||||||
# pybuilddir.txt will be created by --generate-posix-vars in the Makefile
|
# pybuilddir.txt will be created by --generate-posix-vars in the Makefile
|
||||||
rm -f pybuilddir.txt
|
rm -f pybuilddir.txt
|
||||||
|
|
||||||
AC_CHECK_PROGS(PYTHON_FOR_REGEN, python$PACKAGE_VERSION python3 python, python3)
|
AC_CHECK_PROGS([PYTHON_FOR_REGEN],
|
||||||
|
[python$PACKAGE_VERSION python3.10 python3.9 python3.8 python3.7 python3.6 python3 python],
|
||||||
|
[python3])
|
||||||
AC_SUBST(PYTHON_FOR_REGEN)
|
AC_SUBST(PYTHON_FOR_REGEN)
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([Python for regen version])
|
||||||
|
if command -v $PYTHON_FOR_REGEN >/dev/null 2>&1; then
|
||||||
|
AC_MSG_RESULT([$($PYTHON_FOR_REGEN -V 2>/dev/null)])
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT([missing])
|
||||||
|
fi
|
||||||
|
|
||||||
if test "$cross_compiling" = yes; then
|
if test "$cross_compiling" = yes; then
|
||||||
AC_MSG_CHECKING([for python interpreter for cross build])
|
AC_MSG_CHECKING([for python interpreter for cross build])
|
||||||
if test -z "$PYTHON_FOR_BUILD"; then
|
if test -z "$PYTHON_FOR_BUILD"; then
|
||||||
|
|
Loading…
Reference in a new issue