From 9dbce774eea515e400954f1d0ffbd858c839b546 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Wed, 15 Mar 2023 15:44:17 -0700 Subject: [PATCH] [lldb] Update PythonDataObjectsTests for new exception formatting PythonDataObjectsTest.TestExceptions started failing because the output of the python traceback printers is now consistent between python and cpython [1]. Work around the issue by supporting both variants. Thanks to Ismail for identifying the root cause. [1] https://github.com/python/cpython/issues/85203 --- .../ScriptInterpreter/Python/PythonDataObjectsTests.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp b/lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp index 2bf713e..733b919 100644 --- a/lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp +++ b/lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp @@ -802,10 +802,13 @@ def main(): PythonScript lol(script2); - EXPECT_THAT_EXPECTED(lol(), - llvm::Failed(testing::Property( - &PythonException::ReadBacktrace, - testing::ContainsRegex("unprintable MyError")))); + EXPECT_THAT_EXPECTED( + lol(), + llvm::Failed(testing::Property( + &PythonException::ReadBacktrace, + testing::AnyOf( + testing::ContainsRegex("MyError: "), + testing::ContainsRegex("unprintable MyError"))))); #endif } -- 2.7.4