From 44506cd7f2b0758d37611d405beb6eb1f6f90f17 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Thu, 10 Oct 2019 12:07:30 +0000 Subject: TestFileHandle.py: relax exception type checks the exceptions returned differ between swig4 (TypeError) and swig<=3 (NotImplementedError). Just check for the base Exception class instead. Theoretically we could switch on the swig version and expect the precise type directly, but checking the exact type does not seem that important. Thanks to Raphael for helping me figure this out. llvm-svn: 374322 --- .../Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lldb/packages/Python/lldbsuite/test/python_api') diff --git a/lldb/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py b/lldb/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py index ce3a679fdc9..876a149eada 100644 --- a/lldb/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py +++ b/lldb/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py @@ -667,10 +667,10 @@ class FileHandleTestCase(lldbtest.TestBase): @add_test_categories(['pyapi']) def test_exceptions(self): - self.assertRaises(TypeError, lldb.SBFile, None) - self.assertRaises(TypeError, lldb.SBFile, "ham sandwich") + self.assertRaises(Exception, lldb.SBFile, None) + self.assertRaises(Exception, lldb.SBFile, "ham sandwich") if sys.version_info[0] < 3: - self.assertRaises(TypeError, lldb.SBFile, ReallyBadIO()) + self.assertRaises(Exception, lldb.SBFile, ReallyBadIO()) else: self.assertRaises(OhNoe, lldb.SBFile, ReallyBadIO()) error, n = lldb.SBFile(BadIO()).Write(b"FOO") -- cgit v1.2.3