File tree 1 file changed +11
-6
lines changed
1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -5280,14 +5280,19 @@ static PyObject *
5280
5280
int_as_integer_ratio_impl (PyObject * self )
5281
5281
/*[clinic end generated code: output=e60803ae1cc8621a input=55ce3058e15de393]*/
5282
5282
{
5283
- if PyLong_CheckExact (self ) {
5283
+ PyObject * numerator ;
5284
+ PyObject * ratio_tuple ;
5285
+
5286
+ if (PyLong_CheckExact (self )) {
5284
5287
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 ;
5290
5288
}
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 ;
5291
5296
}
5292
5297
5293
5298
/*[clinic input]
You can’t perform that action at this time.
0 commit comments