Skip to content

Commit cf19bc7

Browse files
Remove unnecessary type checks since PyFloat_AsDouble() will convert the value
to floating point if possible anyway, and if not, will raise an appropriate exception.
1 parent 273d36e commit cf19bc7

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

src/NumberVar.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,6 @@ static int NumberVar_SetValueDecimal(udt_Variable *var, uint32_t pos,
198198
static int NumberVar_SetValueFloat(udt_Variable *var, uint32_t pos,
199199
dpiData *data, PyObject *value)
200200
{
201-
if (!PyFloat_Check(value) &&
202-
#if PY_MAJOR_VERSION < 3
203-
!PyInt_Check(value) &&
204-
#endif
205-
!PyLong_Check(value)) {
206-
PyErr_SetString(PyExc_TypeError, "expecting float");
207-
return -1;
208-
}
209201
data->value.asDouble = PyFloat_AsDouble(value);
210202
if (PyErr_Occurred())
211203
return -1;

0 commit comments

Comments
 (0)