[totem] build: Use idiomatic way of detecting Python3
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem] build: Use idiomatic way of detecting Python3
- Date: Thu, 10 Aug 2017 09:18:45 +0000 (UTC)
commit 18697d303d0cb9a0177167e0fc8b98722e19717c
Author: Bastien Nocera <hadess hadess net>
Date: Thu Aug 10 10:56:47 2017 +0200
build: Use idiomatic way of detecting Python3
And up the required Python version. We haven't supported running against
Python2 since 2013, so try to detect a Python3 newer than "3.0".
This also fixes running "python --version" (call had incorrect syntax)
and gathering the version number (version appears on stdout, not stderr
like it did for Python2).
https://bugzilla.gnome.org/show_bug.cgi?id=786082
meson.build | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/meson.build b/meson.build
index efb961f..c041657 100644
--- a/meson.build
+++ b/meson.build
@@ -211,12 +211,12 @@ python_deps = []
python_option = get_option('enable-python')
if python_option != 'no'
- python = find_program('python', required: false)
+ python = import('python3').find_python()
if python.found()
- python_req_version = '>= 2.3'
+ python_req_version = '>= 3.0'
- r = run_command(python, '--version')
- python_version = r.stderr().split(' ')[1]
+ r = run_command([python, '--version'])
+ python_version = r.stdout().split(' ')[1]
pygobject_dep = dependency('pygobject-3.0', version: '>= 2.90.3', required: false)
pylint = find_program('pylint', required: false)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]