2to3 detection for Windows Python distributions

The 2to3 standalone tool does not exist on Windows. Use the 2to3.py
script instead.
This commit is contained in:
William S Fulton 2018-11-17 12:22:23 +00:00
commit 1540ff451f

View file

@ -911,6 +911,17 @@ if test -n "$PYTHON3"; then
if test "x$PY2TO3BIN" = xyes; then
py3to2=`echo $PYTHON3 | sed -e "s/python/2to3-/"`
AC_CHECK_PROGS(PY2TO3, $py3to2 2to3)
if test -z "$PY2TO3"; then
# Windows distributions don't always have the 2to3 executable
AC_MSG_CHECKING(for 2to3.py)
py2to3script="$PY3PREFIX/Tools/scripts/2to3.py"
if test -f "$py2to3script"; then
AC_MSG_RESULT($py2to3script)
PY2TO3="$PYTHON3 $py2to3script"
else
AC_MSG_RESULT(Not found)
fi
fi
else
PY2TO3="$PY2TO3BIN"
fi