File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -5280,14 +5280,19 @@ static PyObject *
52805280int_as_integer_ratio_impl (PyObject * self )
52815281/*[clinic end generated code: output=e60803ae1cc8621a input=55ce3058e15de393]*/
52825282{
5283- if PyLong_CheckExact (self ) {
5283+ PyObject * numerator ;
5284+ PyObject * ratio_tuple ;
5285+
5286+ if (PyLong_CheckExact (self )) {
52845287 return PyTuple_Pack (2 , self , _PyLong_One );
5285- } else {
5286- PyObject * numerator = _PyLong_Copy (self );
5287- PyObject * ratio_tuple = PyTuple_Pack (2 , numerator , _PyLong_One );
5288- Py_DECREF (numerator );
5289- return ratio_tuple ;
52905288 }
5289+ numerator = _PyLong_Copy (self );
5290+ if (numerator == NULL ) {
5291+ return NULL ;
5292+ }
5293+ ratio_tuple = PyTuple_Pack (2 , numerator , _PyLong_One );
5294+ Py_DECREF (numerator );
5295+ return ratio_tuple ;
52915296}
52925297
52935298/*[clinic input]
You can’t perform that action at this time.
0 commit comments