summaryrefslogtreecommitdiffstats
path: root/Modules/mathmodule.c
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2010-07-02 16:05:15 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2010-07-02 16:05:15 (GMT)
commit6d02d9cc6bbf8e53424e8403e63d5583a4a17d58 (patch)
treebe5de69b9286230b890997ecbf9cf7d66377a6fb /Modules/mathmodule.c
parent9fc68c4e7052a0d05753e4ef0ee9edbe68f810eb (diff)
downloadcpython-6d02d9cc6bbf8e53424e8403e63d5583a4a17d58.zip
cpython-6d02d9cc6bbf8e53424e8403e63d5583a4a17d58.tar.gz
cpython-6d02d9cc6bbf8e53424e8403e63d5583a4a17d58.tar.bz2
Style/consistency nit: make math_floor and math_ceil code look the same.
Diffstat (limited to 'Modules/mathmodule.c')
-rw-r--r--Modules/mathmodule.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c
index 9141805..4ef10d3 100644
--- a/Modules/mathmodule.c
+++ b/Modules/mathmodule.c
@@ -841,7 +841,7 @@ FUNC1(atanh, m_atanh, 0,
static PyObject * math_ceil(PyObject *self, PyObject *number) {
static PyObject *ceil_str = NULL;
- PyObject *method;
+ PyObject *method, *result;
method = _PyObject_LookupSpecial(number, "__ceil__", &ceil_str);
if (method == NULL) {
@@ -849,11 +849,9 @@ static PyObject * math_ceil(PyObject *self, PyObject *number) {
return NULL;
return math_1_to_int(number, ceil, 0);
}
- else {
- PyObject *result = PyObject_CallFunctionObjArgs(method, NULL);
- Py_DECREF(method);
- return result;
- }
+ result = PyObject_CallFunctionObjArgs(method, NULL);
+ Py_DECREF(method);
+ return result;
}
PyDoc_STRVAR(math_ceil_doc,