File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
numpy/core/src/multiarray Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -4607,15 +4607,13 @@ PyMODINIT_FUNC initmultiarray(void) {
4607
4607
if (PyType_Ready (& NpyBusDayCalendar_Type ) < 0 ) {
4608
4608
return RETVAL ;
4609
4609
}
4610
- /* FIXME
4611
- * There is no error handling here
4612
- */
4610
+
4613
4611
c_api = NpyCapsule_FromVoidPtr ((void * )PyArray_API , NULL );
4614
- PyDict_SetItemString (d , "_ARRAY_API" , c_api );
4615
- Py_DECREF (c_api );
4616
- if (PyErr_Occurred ()) {
4612
+ if (c_api == NULL ) {
4617
4613
goto err ;
4618
4614
}
4615
+ PyDict_SetItemString (d , "_ARRAY_API" , c_api );
4616
+ Py_DECREF (c_api );
4619
4617
4620
4618
/*
4621
4619
* PyExc_Exception should catch all the standard errors that are
@@ -4633,10 +4631,10 @@ PyMODINIT_FUNC initmultiarray(void) {
4633
4631
PyDict_SetItemString (d , "__version__" , s );
4634
4632
Py_DECREF (s );
4635
4633
4636
- /* FIXME
4637
- * There is no error handling here
4638
- */
4639
4634
s = NpyCapsule_FromVoidPtr ((void * )_datetime_strings , NULL );
4635
+ if (s == NULL ) {
4636
+ goto err ;
4637
+ }
4640
4638
PyDict_SetItemString (d , "DATETIMEUNITS" , s );
4641
4639
Py_DECREF (s );
4642
4640
You can’t perform that action at this time.
0 commit comments