mirror of https://github.com/python/cpython
Fix-up parenthesis, organization, and NULL check (GH-9297)
This commit is contained in:
parent
902bcd9a1e
commit
00bc08ec11
|
@ -5280,15 +5280,20 @@ static PyObject *
|
||||||
int_as_integer_ratio_impl(PyObject *self)
|
int_as_integer_ratio_impl(PyObject *self)
|
||||||
/*[clinic end generated code: output=e60803ae1cc8621a input=55ce3058e15de393]*/
|
/*[clinic end generated code: output=e60803ae1cc8621a input=55ce3058e15de393]*/
|
||||||
{
|
{
|
||||||
if PyLong_CheckExact(self) {
|
PyObject *numerator;
|
||||||
|
PyObject *ratio_tuple;
|
||||||
|
|
||||||
|
if (PyLong_CheckExact(self)) {
|
||||||
return PyTuple_Pack(2, self, _PyLong_One);
|
return PyTuple_Pack(2, self, _PyLong_One);
|
||||||
} else {
|
}
|
||||||
PyObject *numerator = _PyLong_Copy(self);
|
numerator = _PyLong_Copy(self);
|
||||||
PyObject *ratio_tuple = PyTuple_Pack(2, numerator, _PyLong_One);
|
if (numerator == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
ratio_tuple = PyTuple_Pack(2, numerator, _PyLong_One);
|
||||||
Py_DECREF(numerator);
|
Py_DECREF(numerator);
|
||||||
return ratio_tuple;
|
return ratio_tuple;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/*[clinic input]
|
/*[clinic input]
|
||||||
int.to_bytes
|
int.to_bytes
|
||||||
|
|
Loading…
Reference in New Issue