aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2023-06-10 18:10:04 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2023-06-10 18:10:04 +0300
commitb4d7d733a4492b3ccf2b5c4246c8d318d3d37e2f (patch)
tree571c9bc1a3d423fcbed6496c06ebad03bee8376f
parente20717ed8f9f746a233e2bd2b3018997a3f73799 (diff)
downloadmeson-fromlongmsg.zip
meson-fromlongmsg.tar.gz
meson-fromlongmsg.tar.bz2
Strip out garbage debug text.fromlongmsg
-rw-r--r--mesonbuild/dependencies/python.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/mesonbuild/dependencies/python.py b/mesonbuild/dependencies/python.py
index 2410007..ed8f214 100644
--- a/mesonbuild/dependencies/python.py
+++ b/mesonbuild/dependencies/python.py
@@ -105,6 +105,10 @@ class BasicPythonExternalProgram(ExternalProgram):
return mesonlib.version_compare(version, '>= 3.0')
return True
+ def strip_buggy_debug_info(self, text):
+ # https://github.com/microsoft/debugpy/issues/1100
+ return '\n'.join([x for x in text.split('\n') if 'PyInt_FromLong not found' not in x])
+
def sanity(self) -> bool:
# Sanity check, we expect to have something that at least quacks in tune
@@ -115,7 +119,7 @@ class BasicPythonExternalProgram(ExternalProgram):
p, stdout, stderr = mesonlib.Popen_safe(cmd)
try:
- info = json.loads(stdout)
+ info = json.loads(self.strip_buggy_debug_info(stdout))
except json.JSONDecodeError:
info = None
mlog.debug('Could not introspect Python (%s): exit code %d' % (str(p.args), p.returncode))