From cc306fc4e02669254e9a606a82118b45385cf93c Mon Sep 17 00:00:00 2001
From: Justin Carpentier <justin.carpentier@inria.fr>
Date: Thu, 20 Feb 2020 13:02:49 +0100
Subject: [PATCH] travis: set default python version

---
 .travis.yml                         | 2 +-
 travis_custom/custom_before_install | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index f6f1bbc..b9ea312 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -75,7 +75,7 @@ script:
   - mkdir build
   - cd build
   - export CMAKE_PREFIX_PATH=/tmp/_ci/install
-  - cmake ..
+  - cmake .. -DPYTHON_EXECUTABLE=$PYTHON_DEFAULT_VERSION
   - make
   - ./extra_lib
   - cd /tmp/_ci/build
diff --git a/travis_custom/custom_before_install b/travis_custom/custom_before_install
index 9fbf67f..678c5f6 100755
--- a/travis_custom/custom_before_install
+++ b/travis_custom/custom_before_install
@@ -2,8 +2,10 @@
 
 # Add Python dependency
 echo "TRAVIS_PYTHON_VERSION=$TRAVIS_PYTHON_VERSION"
+export PYTHON_DEFAULT_VERSION=$(which python2)
 if [[ $TRAVIS_PYTHON_VERSION -gt 30 ]]; then
   export APT_DEPENDENCIES=$APT_DEPENDENCIES" python3-numpy"
+  export PYTHON_DEFAULT_VERSION=$(which python3)
 fi
 
 # When this script is called the current directory is ./custom_travis
-- 
GitLab