aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/python3.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-01-08 23:35:59 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2017-01-09 21:23:18 +0200
commit6ac9a8e738dae97c64308da83949931fb726bbe7 (patch)
tree17d4a5db37d2df3c3748ec767701f74882fa912e /mesonbuild/modules/python3.py
parentfbabe8ad85725762e46b7c4c2f2c680c3351ec80 (diff)
downloadmeson-6ac9a8e738dae97c64308da83949931fb726bbe7.zip
meson-6ac9a8e738dae97c64308da83949931fb726bbe7.tar.gz
meson-6ac9a8e738dae97c64308da83949931fb726bbe7.tar.bz2
Add .find_python() method. Supersedes #777.
Diffstat (limited to 'mesonbuild/modules/python3.py')
-rw-r--r--mesonbuild/modules/python3.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/mesonbuild/modules/python3.py b/mesonbuild/modules/python3.py
index 9b6e71e..53e28c4 100644
--- a/mesonbuild/modules/python3.py
+++ b/mesonbuild/modules/python3.py
@@ -12,9 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from .. import mesonlib
+import sys
+from .. import mesonlib, dependencies
from . import ExtensionModule
+from mesonbuild.modules import ModuleReturnValue
class Python3Module(ExtensionModule):
def __init__(self):
@@ -39,5 +41,9 @@ class Python3Module(ExtensionModule):
kwargs['name_suffix'] = suffix
return interpreter.func_shared_module(None, args, kwargs)
+ def find_python(self, state, args, kwargs):
+ py3 = dependencies.ExternalProgram('python3', sys.executable, silent=True)
+ return ModuleReturnValue(py3, [py3])
+
def initialize():
return Python3Module()