summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/cextension/processors.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/lib/sqlalchemy/cextension/processors.c b/lib/sqlalchemy/cextension/processors.c
index b539f6843..427db5d8e 100644
--- a/lib/sqlalchemy/cextension/processors.c
+++ b/lib/sqlalchemy/cextension/processors.c
@@ -342,23 +342,18 @@ DecimalResultProcessor_process(DecimalResultProcessor *self, PyObject *value)
if (value == Py_None)
Py_RETURN_NONE;
- if (PyFloat_CheckExact(value)) {
- /* Decimal does not accept float values directly */
- args = PyTuple_Pack(1, value);
- if (args == NULL)
- return NULL;
+ args = PyTuple_Pack(1, value);
+ if (args == NULL)
+ return NULL;
- str = PyString_Format(self->format, args);
- Py_DECREF(args);
- if (str == NULL)
- return NULL;
+ str = PyString_Format(self->format, args);
+ Py_DECREF(args);
+ if (str == NULL)
+ return NULL;
- result = PyObject_CallFunctionObjArgs(self->type, str, NULL);
- Py_DECREF(str);
- return result;
- } else {
- return PyObject_CallFunctionObjArgs(self->type, value, NULL);
- }
+ result = PyObject_CallFunctionObjArgs(self->type, str, NULL);
+ Py_DECREF(str);
+ return result;
}
static void