From 3eba23f1737b4401ec97091b2d58ea6bea3a6528 Mon Sep 17 00:00:00 2001
From: Justin Carpentier <justin.carpentier@inria.fr>
Date: Thu, 20 Feb 2020 13:51:04 +0100
Subject: [PATCH] travis: fix Python search

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

diff --git a/.travis.yml b/.travis.yml
index f4bb32d7..a35bbdd1 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -75,7 +75,9 @@ script:
   - mkdir build
   - cd build
   - export CMAKE_PREFIX_PATH=/tmp/_ci/install
-  - cmake .. -DPYTHON_EXECUTABLE=$PYTHON_DEFAULT_VERSION -DPYTHON_INCLUDE_DIR=$($PYTHON_DEFAULT_VERSION -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") -DPYTHON_LIBRARY=$($PYTHON_DEFAULT_VERSION -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('LIBDIR'))")
+  - export PYTHON_DEFAULT_VERSION=$(which python2)
+  - if [[ $TRAVIS_PYTHON_VERSION -gt 30 ]]; then export PYTHON_DEFAULT_VERSION=$(which python3); fi
+  - 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 678c5f66..9fbf67f3 100755
--- a/travis_custom/custom_before_install
+++ b/travis_custom/custom_before_install
@@ -2,10 +2,8 @@
 
 # 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