(bench) python fasttimer should check for exceptions
This commit is contained in:
parent
cd25ada161
commit
b2846c13ce
@ -29,6 +29,10 @@ fasttimer_timeit(PyObject * self, PyObject * args, PyObject* kwargs)
|
|||||||
for (int t = 0; t < times; ++t) {
|
for (int t = 0; t < times; ++t) {
|
||||||
/* Call it here */
|
/* Call it here */
|
||||||
PyObject_CallObject(callable, NULL);
|
PyObject_CallObject(callable, NULL);
|
||||||
|
if (PyErr_Occurred()) {
|
||||||
|
Py_XDECREF(callable);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
gettimeofday(&tv_after,NULL);
|
gettimeofday(&tv_after,NULL);
|
||||||
Py_XDECREF(callable);
|
Py_XDECREF(callable);
|
||||||
|
Loading…
Reference in New Issue
Block a user