aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authorrm <rm@FreeBSD.org>2012-05-26 01:13:10 +0800
committerrm <rm@FreeBSD.org>2012-05-26 01:13:10 +0800
commit82ff6f48b1fb668240c111de48e763276130559b (patch)
treed19db662eacf4bc2b640e51543e1be99a2ff7473 /Mk
parent07ebb8a774d181fe1490b96e88f455c1da741675 (diff)
downloadfreebsd-ports-gnome-82ff6f48b1fb668240c111de48e763276130559b.tar.gz
freebsd-ports-gnome-82ff6f48b1fb668240c111de48e763276130559b.tar.zst
freebsd-ports-gnome-82ff6f48b1fb668240c111de48e763276130559b.zip
Fix incompatibilities with python 3.x (mostly calling print as function).
PR: 166226 Submitted by: Mel Flynn <rflynn at acsalaska dot net> Approved by: portmgr (pav)
Diffstat (limited to 'Mk')
-rw-r--r--Mk/bsd.python.mk14
1 files changed, 7 insertions, 7 deletions
diff --git a/Mk/bsd.python.mk b/Mk/bsd.python.mk
index b91934aabf97..fc437c69b453 100644
--- a/Mk/bsd.python.mk
+++ b/Mk/bsd.python.mk
@@ -264,7 +264,7 @@ PYTHON_VERSION= python2.4
.if !defined(PYTHON_DEFAULT_VERSION)
. if exists(${LOCALBASE}/bin/python)
_PYTHON_DEFAULT_VERSION!= (${LOCALBASE}/bin/python -c \
- 'import sys; print sys.version[:3]' 2> /dev/null \
+ 'import sys; print(sys.version[:3])' 2> /dev/null \
|| ${ECHO_CMD} ${_PYTHON_PORTBRANCH}) | ${TAIL} -1
. else
_PYTHON_DEFAULT_VERSION= ${_PYTHON_PORTBRANCH}
@@ -336,7 +336,7 @@ _PYTHON_VERSION= ${_PYTHON_PORTBRANCH} # just to avoid version sanity checking.
PYTHON_VERSION?= python${_PYTHON_VERSION}
PYTHON_CMD?= ${_PYTHON_CMD}
.if !defined(PYTHONBASE)
-PYTHONBASE!= (${PYTHON_CMD} -c 'import sys; print sys.prefix' \
+PYTHONBASE!= (${PYTHON_CMD} -c 'import sys; print(sys.prefix)' \
2> /dev/null || ${ECHO_CMD} ${LOCALBASE}) | ${TAIL} -1
.endif
DEPENDS_ARGS+= PYTHON_VERSION=${PYTHON_VERSION}
@@ -345,8 +345,8 @@ DEPENDS_ARGS+= PYTHON_VERSION=${PYTHON_VERSION}
# should point to some other version we have installed, according to the port USE_PYTHON
# specification
.if !defined(PYTHON_DEFAULT_PORTVERSION) || (${PYTHON_VERSION} != ${PYTHON_DEFAULT_VERSION})
-_PYTHON_PORTVERSION!= (${PYTHON_CMD} -c 'import string, sys; \
- print string.split(sys.version)[0].replace("b",".b")' 2> /dev/null) | ${TAIL} -1
+_PYTHON_PORTVERSION!= (${PYTHON_CMD} -c 'import sys; \
+ print(sys.version.split()[0].replace("b",".b"))' 2> /dev/null) | ${TAIL} -1
.if !defined(PYTHON_NO_DEPENDS) && !empty(_PYTHON_PORTVERSION)
PYTHON_PORTVERSION= ${_PYTHON_PORTVERSION}
.endif
@@ -413,10 +413,10 @@ PYTHON_VER= 2.4
PYTHON_PORTSDIR= # empty
PYTHON_NO_DEPENDS= YES
PYTHON_REL!= ${PYTHON_CMD} -c 'import sys; h = "%x" % sys.hexversion; \
- print h[0]+h[2]+h[4]'
+ print(h[0]+h[2]+h[4])'
PYTHON_SUFFIX!= ${PYTHON_CMD} -c 'import sys; h = "%x" % sys.hexversion; \
- print h[0]+h[2]'
-PYTHON_VER!= ${PYTHON_CMD} -c 'import sys; print sys.version[:3]'
+ print(h[0]+h[2])'
+PYTHON_VER!= ${PYTHON_CMD} -c 'import sys; print(sys.version[:3])'
.else
check-makevars::