aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/python.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2021-08-18 15:30:40 -0400
committerEli Schwartz <eschwartz@archlinux.org>2021-08-18 17:54:52 -0400
commit445f08869bb076a32a59653ef0db22d77366745e (patch)
treeb96090d46604a6ff6ec709b9f4f161d534da831e /mesonbuild/modules/python.py
parent9eac9e0ff20d7716b90ad5c61cfffc6cc6630005 (diff)
downloadmeson-445f08869bb076a32a59653ef0db22d77366745e.zip
meson-445f08869bb076a32a59653ef0db22d77366745e.tar.gz
meson-445f08869bb076a32a59653ef0db22d77366745e.tar.bz2
Fix incorrect .name attribute for python program
It is always set to python3 even if we asked for python2...
Diffstat (limited to 'mesonbuild/modules/python.py')
-rw-r--r--mesonbuild/modules/python.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py
index 5fea843..b56bd38 100644
--- a/mesonbuild/modules/python.py
+++ b/mesonbuild/modules/python.py
@@ -316,7 +316,7 @@ class PythonExternalProgram(ExternalProgram):
if ext_prog is None:
super().__init__(name, command=command, silent=True)
else:
- self.name = ext_prog.name
+ self.name = name
self.command = ext_prog.command
self.path = ext_prog.path
@@ -567,6 +567,7 @@ class PythonModule(ExtensionModule):
# $PATH, or that uses a wrapper of some kind.
np: T.List[str] = state.environment.lookup_binary_entry(MachineChoice.HOST, 'python') or []
fallback = args[0]
+ display_name = fallback or 'python'
if not np and fallback is not None:
np = [fallback]
name_or_path = np[0] if np else None
@@ -578,8 +579,8 @@ class PythonModule(ExtensionModule):
if not name_or_path:
python = PythonExternalProgram('python3', mesonlib.python_command)
else:
- tmp_python = ExternalProgram.from_entry('python3', name_or_path)
- python = PythonExternalProgram('python3', ext_prog=tmp_python)
+ tmp_python = ExternalProgram.from_entry(display_name, name_or_path)
+ python = PythonExternalProgram(display_name, ext_prog=tmp_python)
if not python.found() and mesonlib.is_windows():
pythonpath = self._get_win_pythonpath(name_or_path)