Skip to content

Commit 44506cd

Browse files
committed
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
1 parent 38ac46b commit 44506cd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lldb/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -667,10 +667,10 @@ def test_file_error(self):
667667

668668
@add_test_categories(['pyapi'])
669669
def test_exceptions(self):
670-
self.assertRaises(TypeError, lldb.SBFile, None)
671-
self.assertRaises(TypeError, lldb.SBFile, "ham sandwich")
670+
self.assertRaises(Exception, lldb.SBFile, None)
671+
self.assertRaises(Exception, lldb.SBFile, "ham sandwich")
672672
if sys.version_info[0] < 3:
673-
self.assertRaises(TypeError, lldb.SBFile, ReallyBadIO())
673+
self.assertRaises(Exception, lldb.SBFile, ReallyBadIO())
674674
else:
675675
self.assertRaises(OhNoe, lldb.SBFile, ReallyBadIO())
676676
error, n = lldb.SBFile(BadIO()).Write(b"FOO")

0 commit comments

Comments
 (0)