Explorar o código

Merge remote-tracking branch 'teor/fallback-to-python'

Nick Mathewson %!s(int64=8) %!d(string=hai) anos
pai
achega
971eb49caa
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      chutney

+ 8 - 0
chutney

@@ -1,4 +1,12 @@
 #!/bin/sh
 
 export PYTHONPATH="`dirname $0`/lib:${PYTHONPATH}"
+# Use python2, python, python3 in that order
+[ -n "$PYTHON" ] || {
+    command -v python2 >/dev/null 2>&1 && PYTHON=python2 || \
+    command -v python >/dev/null 2>&1 && PYTHON=python # || \
+#   Not yet supported 
+#   command -v python3 >/dev/null 2>&1 && PYTHON=python3
+}
+# Use python2 if the checks that use "command" fail
 ${PYTHON:=python2} -m chutney.TorNet "$@"