Skip to content

Commit 8dfd842

Browse files
Revert last change (restriction is deliberate).
1 parent cf19bc7 commit 8dfd842

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/NumberVar.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,14 @@ 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+
}
201209
data->value.asDouble = PyFloat_AsDouble(value);
202210
if (PyErr_Occurred())
203211
return -1;

0 commit comments

Comments
 (0)