Skip to contentSkip to conversation

python3: Substitute correct python version in shebang

PATCH New Tyler Hall 1 participant 1 message May 5, 2014

lore
Share & tools
lore

Tyler Hall

author
#0 lore raw

PATCH v2 1/1 python3: Substitute correct python version in shebang

If python2 and python3 are both available, scripts that are subject to this substitution can possibly run with the wrong python version. python3-config is one such script.

---

v2: Update comment

 meta/recipes-devtools/python/python3-native_3.3.3.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-devtools/python/python3-native_3.3.3.bb +2 -2
index 7238eaf..ead0348 100644
@@ -69,8 +69,8 @@ do_install() {
 	install -d ${D}${bindir}/${PN}
 	install -m 0755 Parser/pgen ${D}${bindir}/${PN}
 
-	# Make sure we use /usr/bin/env python
+	# Make sure we use python3 from $PATH
 	for PYTHSCRIPT in `grep -rIl ${bindir}/${PN}/python ${D}${bindir}/${PN}`; do
-		sed -i -e '1s|^#!.*|#!/usr/bin/env python|' $PYTHSCRIPT
+		sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' $PYTHSCRIPT
 	done
 }
Signature · 1 line
1.9.2