8000 more log fixes · matplotlib/matplotlib@36c8bb1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 36c8bb1

Browse files
committed
more log fixes
svn path=/trunk/matplotlib/; revision=956
1 parent d4fdf5d commit 36c8bb1

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/_transforms.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,13 @@ Transformation::nonlinear_only_numerix(const Py::Tuple & args) {
901901
double thisx = *(double *)(x->data + i*x->strides[0]);
902902
double thisy = *(double *)(y->data + i*y->strides[0]);
903903
//std::cout << "calling operator " << thisx << " " << thisy << " " << std::endl;
904-
this->nonlinear_only_api(&thisx, &thisy);
904+
try {
905+
this->nonlinear_only_api(&thisx, &thisy);
906+
}
907+
catch (std::domain_error &err) {
908+
throw Py::ValueError("Domain error on this->nonlinear_only_api(&thisx, &thisy) in Transformation::nonlinear_only_numerix");
909+
}
910+
905911
*(double *)(retx->data + i*retx->strides[0]) = thisx;
906912
*(double *)(rety->data + i*rety->strides[0]) = thisy;
907913
}

src/_transforms.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,14 @@ class Transformation: public Py::PythonExtension<Transformation> {
483483

484484
Py::Object as_vec6_val(const Py::Tuple &args) {
485485
double a,b,c,d,tx,ty;
486-
affine_params_api(&a, &b, &c, &d, &tx, &ty);
486+
487+
try {
488+
affine_params_api(&a, &b, &c, &d, &tx, &ty);
489+
}
490+
catch (std::domain_error &err) {
491+
throw Py::ValueError("Domain error on as_vec6_val in Transformation::as_vec6_val");
492+
}
493+
487494
Py::Tuple ret(6);
488495
ret[0] = Py::Float(a);
489496
ret[1] = Py::Float(b);

0 commit comments

Comments
 (0)
0