From 455c33fb29e9faf1fb054a4a290c626020e76b2a Mon Sep 17 00:00:00 2001 From: James Duley Date: Tue, 6 May 2014 15:22:44 +1200 Subject: [PATCH] check whether python is python 2 use python2 if not --- ground/openpilotgcs/src/python.pri | 2 +- make/tools.mk | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ground/openpilotgcs/src/python.pri b/ground/openpilotgcs/src/python.pri index 739fc2cc9..62d03795f 100644 --- a/ground/openpilotgcs/src/python.pri +++ b/ground/openpilotgcs/src/python.pri @@ -15,7 +15,7 @@ OPENPILOT_TOOLS_DIR = $$(OPENPILOT_TOOLS_DIR) PYTHON = \"$$ROOT_DIR/tools/$$PYTHON_DIR/python\" } else { # not found, hope it's in the path... - PYTHON = \"python\" + PYTHON = $$(PYTHON) } } diff --git a/make/tools.mk b/make/tools.mk index 5771abf28..d757091da 100644 --- a/make/tools.mk +++ b/make/tools.mk @@ -597,7 +597,11 @@ ifeq ($(shell [ -d "$(PYTHON_DIR)" ] && $(ECHO) "exists"), exists) else # not installed, hope it's in the path... # $(info $(EMPTY) WARNING $(call toprel, $(PYTHON_DIR)) not found, using system PATH) - export PYTHON := python + ifeq ($(findstring Python 2,$(shell python --version)), Python 2) + export PYTHON := python + else + export PYTHON := python2 + endif endif .PHONY: python_version