diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2023-06-10 18:10:04 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2023-06-10 18:10:04 +0300 |
commit | b4d7d733a4492b3ccf2b5c4246c8d318d3d37e2f (patch) | |
tree | 571c9bc1a3d423fcbed6496c06ebad03bee8376f | |
parent | e20717ed8f9f746a233e2bd2b3018997a3f73799 (diff) | |
download | meson-fromlongmsg.zip meson-fromlongmsg.tar.gz meson-fromlongmsg.tar.bz2 |
Strip out garbage debug text.fromlongmsg
-rw-r--r-- | mesonbuild/dependencies/python.py | 6 |
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)) |