From bf12b40c2a93b11c3666619a474d35bcfea20837 Mon Sep 17 00:00:00 2001 From: Dirk Thomas Date: Tue, 3 Jun 2014 17:05:34 -0700 Subject: [PATCH] use PYTHON_EXECUTABLE for _setup_util.py --- cmake/templates/_setup_util.py.in | 2 +- python/catkin/builder.py | 1 + test/unit_tests/test_setup_util.py | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/templates/_setup_util.py.in b/cmake/templates/_setup_util.py.in index 1f92d75aa..46c862805 100755 --- a/cmake/templates/_setup_util.py.in +++ b/cmake/templates/_setup_util.py.in @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!@PYTHON_EXECUTABLE@ # Software License Agreement (BSD License) # diff --git a/python/catkin/builder.py b/python/catkin/builder.py index 88424af1d..ca4a9fa80 100644 --- a/python/catkin/builder.py +++ b/python/catkin/builder.py @@ -929,6 +929,7 @@ def build_workspace_isolated( 'CATKIN_LIB_ENVIRONMENT_PATHS': "'lib'", 'CATKIN_PKGCONFIG_ENVIRONMENT_PATHS': "os.path.join('lib', 'pkgconfig')", 'CMAKE_PREFIX_PATH_AS_IS': ';'.join(os.environ['CMAKE_PREFIX_PATH'].split(os.pathsep)), + 'PYTHON_EXECUTABLE': sys.executable, 'PYTHON_INSTALL_DIR': get_python_install_dir(), } with open(generated_setup_util_py, 'w') as f: diff --git a/test/unit_tests/test_setup_util.py b/test/unit_tests/test_setup_util.py index 62613ad1f..9ec123f6e 100644 --- a/test/unit_tests/test_setup_util.py +++ b/test/unit_tests/test_setup_util.py @@ -1,5 +1,6 @@ import os import shutil +import sys import tempfile import unittest @@ -10,6 +11,7 @@ 'CATKIN_LIB_ENVIRONMENT_PATHS': "'lib'", 'CATKIN_PKGCONFIG_ENVIRONMENT_PATHS': "os.path.join('lib', 'pkgconfig')", 'CATKIN_GLOBAL_BIN_DESTINATION': 'bin', + 'PYTHON_EXECUTABLE': sys.executable, 'PYTHON_INSTALL_DIR': 'pythonX.Y/packages', 'CMAKE_PREFIX_PATH_AS_IS': '', })