mirror of
https://github.com/opencv/opencv.git
synced 2026-07-25 21:33:04 +04:00
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
This commit is contained in:
@@ -209,6 +209,11 @@ catch (const cv::Exception &e) \
|
||||
{ \
|
||||
pyRaiseCVException(e); \
|
||||
return 0; \
|
||||
} \
|
||||
catch (const std::exception &e) \
|
||||
{ \
|
||||
PyErr_SetString(opencv_error, e.what()); \
|
||||
return 0; \
|
||||
}
|
||||
|
||||
using namespace cv;
|
||||
|
||||
@@ -47,6 +47,12 @@ class Bindings(NewOpenCVTests):
|
||||
boost.getMaxDepth() # from ml::DTrees
|
||||
boost.isClassifier() # from ml::StatModel
|
||||
|
||||
def test_raiseGeneralException(self):
|
||||
with self.assertRaises((cv.error,),
|
||||
msg='C++ exception is not propagated to Python in the right way') as cm:
|
||||
cv.utils.testRaiseGeneralException()
|
||||
self.assertEqual(str(cm.exception), 'exception text')
|
||||
|
||||
def test_redirectError(self):
|
||||
try:
|
||||
cv.imshow("", None) # This causes an assert
|
||||
|
||||
Reference in New Issue
Block a user