File tree Expand file tree Collapse file tree
numpy/core/src/multiarray Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4607,15 +4607,13 @@ PyMODINIT_FUNC initmultiarray(void) {
46074607 if (PyType_Ready (& NpyBusDayCalendar_Type ) < 0 ) {
46084608 return RETVAL ;
46094609 }
4610- /* FIXME
4611- * There is no error handling here
4612- */
4610+
46134611 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 ) {
46174613 goto err ;
46184614 }
4615+ PyDict_SetItemString (d , "_ARRAY_API" , c_api );
4616+ Py_DECREF (c_api );
46194617
46204618 /*
46214619 * PyExc_Exception should catch all the standard errors that are
@@ -4633,10 +4631,10 @@ PyMODINIT_FUNC initmultiarray(void) {
46334631 PyDict_SetItemString (d , "__version__" , s );
46344632 Py_DECREF (s );
46354633
4636- /* FIXME
4637- * There is no error handling here
4638- */
46394634 s = NpyCapsule_FromVoidPtr ((void * )_datetime_strings , NULL );
4635+ if (s == NULL ) {
4636+ goto err ;
4637+ }
46404638 PyDict_SetItemString (d , "DATETIMEUNITS" , s );
46414639 Py_DECREF (s );
46424640
You can’t perform that action at this time.
0 commit comments