From 5751f7b89a2402c582fbd03a136a25a1a0cf6e6e Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Sat, 9 Apr 2022 12:37:44 +0300 Subject: Validate that introspection command exited cleanly. --- mesonbuild/modules/python.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py index 3bbccd1..864d7ab 100644 --- a/mesonbuild/modules/python.py +++ b/mesonbuild/modules/python.py @@ -410,6 +410,8 @@ class PythonExternalProgram(ExternalProgram): # Sanity check, we expect to have something that at least quacks in tune cmd = self.get_command() + ['-c', INTROSPECT_COMMAND] p, stdout, stderr = mesonlib.Popen_safe(cmd) + if p.returncode != 0: + raise mesonlib.MesonException('Trying to introspect Python configuration failed.\n\n' + stdout + stderr) try: info = json.loads(stdout) except json.JSONDecodeError: -- cgit v1.1