File tree 3 files changed +28
-3
lines changed 3 files changed +28
-3
lines changed Original file line number Diff line number Diff line change 5
5
import contextlib
6
6
import os
7
7
import re
8
+ import sys
8
9
import time
9
10
import types
11
+ import unicodedata
10
12
from typing import Dict , FrozenSet , Tuple , TextIO
11
13
12
14
import umarshal
13
15
14
16
verbose = False
15
17
16
18
19
+ def isprintable (b : bytes ) -> bool :
20
+ return all (0x20 <= c < 0x7f for c in b )
21
+
22
+
17
23
def make_string_literal (b : bytes ) -> str :
18
24
res = ['"' ]
19
- if b . isascii () and b . decode ( "ascii" ). isprintable ():
25
+ if isprintable (b ):
20
26
res .append (b .decode ("ascii" ).replace ("\\ " , "\\ \\ " ).replace ("\" " , "\\ \" " ))
21
27
else :
22
28
for i in b :
Original file line number Diff line number Diff line change @@ -3142,7 +3142,7 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
3142
3142
# pybuilddir.txt will be created by --generate-posix-vars in the Makefile
3143
3143
rm -f pybuilddir.txt
3144
3144
3145
- for ac_prog in python$PACKAGE_VERSION python3 python
3145
+ for ac_prog in python$PACKAGE_VERSION python3.10 python3.9 python3.8 python3.7 python3.6 python3 python
3146
3146
do
3147
3147
# Extract the first word of "$ac_prog", so it can be a program name with args.
3148
3148
set dummy $ac_prog; ac_word=$2
@@ -3187,6 +3187,16 @@ test -n "$PYTHON_FOR_REGEN" || PYTHON_FOR_REGEN="python3"
3187
3187
3188
3188
3189
3189
3190
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python for regen version" >&5
3191
+ $as_echo_n "checking Python for regen version... " >&6; }
3192
+ if command -v $PYTHON_FOR_REGEN >/dev/null 2>&1; then
3193
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $($PYTHON_FOR_REGEN -V 2>/dev/null)" >&5
3194
+ $as_echo "$($PYTHON_FOR_REGEN -V 2>/dev/null)" >&6; }
3195
+ else
3196
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: missing" >&5
3197
+ $as_echo "missing" >&6; }
3198
+ fi
3199
+
3190
3200
if test "$cross_compiling" = yes; then
3191
3201
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for python interpreter for cross build" >&5
3192
3202
$as_echo_n "checking for python interpreter for cross build... " >&6; }
Original file line number Diff line number Diff line change @@ -96,9 +96,18 @@ AC_SUBST(host)
96
96
# pybuilddir.txt will be created by --generate-posix-vars in the Makefile
97
97
rm -f pybuilddir.txt
98
98
99
- AC_CHECK_PROGS ( PYTHON_FOR_REGEN , python$PACKAGE_VERSION python3 python , python3 )
99
+ AC_CHECK_PROGS ( [ PYTHON_FOR_REGEN] ,
100
+ [ python$PACKAGE_VERSION python3.10 python3.9 python3.8 python3.7 python3.6 python3 python] ,
101
+ [ python3] )
100
102
AC_SUBST ( PYTHON_FOR_REGEN )
101
103
104
+ AC_MSG_CHECKING ( [ Python for regen version] )
105
+ if command -v $PYTHON_FOR_REGEN >/dev/null 2>&1; then
106
+ AC_MSG_RESULT ( [ $($PYTHON_FOR_REGEN -V 2>/dev/null)] )
107
+ else
108
+ AC_MSG_RESULT ( [ missing] )
109
+ fi
110
+
102
111
if test "$cross_compiling" = yes; then
103
112
AC_MSG_CHECKING ( [ for python interpreter for cross build] )
104
113
if test -z "$PYTHON_FOR_BUILD"; then
You can’t perform that action at this time.
0 commit comments