Replace freezing regex with plain text operations. The regex in question causes Python's regex parser to freeze indefinitely in certain Python versions. That might be due to a bug or because the re does infinite backtracking and it just happened to work on earlier implementations.
diff --git a/unittests/allplatformstests.py b/unittests/allplatformstests.py index 665e0c6..d6c77e9 100644 --- a/unittests/allplatformstests.py +++ b/unittests/allplatformstests.py
@@ -3378,7 +3378,12 @@ md_commands = {k for k,v in md_command_sections.items()} help_output = self._run(self.meson_command + ['--help']) - help_commands = {c.strip() for c in re.findall(r'usage:(?:.+)?{((?:[a-z]+,*)+?)}', help_output, re.MULTILINE|re.DOTALL)[0].split(',')} + self.assertTrue(help_output.startswith('usage: ')) + line1 = help_output.split('\n')[0] + cmndstr = line1.split('{')[1] + self.assertTrue(cmndstr.endswith('} ...')) + help_commands = cmndstr.split('}')[0].split(',') + self.assertTrue(len(help_commands) > 0) self.assertEqual(md_commands | {'help'}, help_commands, f'Doc file: `{doc_path}`')