Skip to content

Commit f201da3

Browse files
committed
Make configure prefer python3 to plain python.
This avoids possibly selecting Python 2.x on systems that have both Python 2 and Python 3. We used to feel that what "python" links to is a user choice that we should honor. However, we're about to cease support for Python 2, so users will no longer have any choice of that sort. This small change is being made ahead of the big Python-2-ectomy so that we can see how much of the buildfarm is not yet prepared for that. Systems with only Python 2 will continue to build that way, for now. Discussion: https://postgr.es/m/[email protected]
1 parent a7f4171 commit f201da3

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

config/python.m4

+5-7
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,12 @@
99
# Look for Python and set the output variable 'PYTHON' if found,
1010
# fail otherwise.
1111
#
12-
# As the Python 3 transition happens and PEP 394 isn't updated, we
13-
# need to cater to systems that don't have unversioned "python" by
14-
# default. Some systems ship with "python3" by default and perhaps
15-
# have "python" in an optional package. Some systems only have
16-
# "python2" and "python3", in which case it's reasonable to prefer the
17-
# newer version.
12+
# Since we are transitioning to supporting only Python 3.x,
13+
# prefer python3 to plain python. If the latter exists at all,
14+
# it very possibly points to python2, which we don't want to
15+
# select unless it's the only choice.
1816
AC_DEFUN([PGAC_PATH_PYTHON],
19-
[PGAC_PATH_PROGS(PYTHON, [python python3 python2])
17+
[PGAC_PATH_PROGS(PYTHON, [python3 python python2])
2018
AC_ARG_VAR(PYTHON, [Python program])dnl
2119
if test x"$PYTHON" = x""; then
2220
AC_MSG_ERROR([Python not found])

configure

+1-1
Original file line numberDiff line numberDiff line change
@@ -10279,7 +10279,7 @@ fi
1027910279

1028010280
if test "$with_python" = yes; then
1028110281
if test -z "$PYTHON"; then
10282-
for ac_prog in python python3 python2
10282+
for ac_prog in python3 python python2
1028310283
do
1028410284
# Extract the first word of "$ac_prog", so it can be a program name with args.
1028510285
set dummy $ac_prog; ac_word=$2

doc/src/sgml/installation.sgml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1875,7 +1875,7 @@ build-postgresql:
18751875
language becomes available. See
18761876
<xref linkend="plpython-python23"/>
18771877
for more information. If this is not set, the following are probed
1878-
in this order: <literal>python python3 python2</literal>.
1878+
in this order: <literal>python3 python python2</literal>.
18791879
</para>
18801880
</listitem>
18811881
</varlistentry>

0 commit comments

Comments
 (0)