File tree Expand file tree Collapse file tree
quaddtype/numpy_quaddtype/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -483,14 +483,9 @@ PyObject* quad_to_pylong(Sleef_quad value)
483483 PyErr_SetString (PyExc_RuntimeError , "Failed to convert quad to string" );
484484 return NULL ;
485485 }
486-
487- PyObject * result = PyLong_FromString (buffer , NULL , 10 );
488-
489- if (result == NULL ) {
490- PyErr_SetString (PyExc_RuntimeError , "Failed to parse integer string" );
491- return NULL ;
492- }
493486
487+ // Already raises ValueError and returns NULL on failure
488+ PyObject * result = PyLong_FromString (buffer , NULL , 10 );
494489 return result ;
495490}
496491
Original file line number Diff line number Diff line change @@ -35,34 +35,30 @@ init_quad_umath(void)
3535 }
3636
3737 if (init_quad_unary_ops (numpy) < 0 ) {
38- PyErr_SetString (PyExc_RuntimeError, " Failed to initialize quad unary operations" );
3938 goto err;
4039 }
4140
4241 if (init_quad_unary_props (numpy) < 0 ) {
43- PyErr_SetString (PyExc_RuntimeError, " Failed to initialize quad unary properties" );
4442 goto err;
4543 }
4644
4745 if (init_quad_binary_ops (numpy) < 0 ) {
48- PyErr_SetString (PyExc_RuntimeError, " Failed to initialize quad binary operations" );
4946 goto err;
5047 }
5148
5249 if (init_quad_comps (numpy) < 0 ) {
53- PyErr_SetString (PyExc_RuntimeError, " Failed to initialize quad comparison operations" );
5450 goto err;
5551 }
5652
5753 if (init_matmul_ops (numpy) < 0 ) {
58- PyErr_SetString (PyExc_RuntimeError, " Failed to initialize quad matrix multiplication operations" );
5954 goto err;
6055 }
6156
6257 Py_DECREF (numpy);
6358 return 0 ;
6459
6560err:
61+ // Already raises appropriate error
6662 Py_DECREF (numpy);
6763 return -1 ;
6864}
You can’t perform that action at this time.
0 commit comments