diff --git a/lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp b/lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp index 2bf713e08576..733b919e2860 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 }