Skip to content

Commit c1e1659

Browse files
Enable cursor.setinputsizes() and cursor.callfunc() to support specifying an
object type where a type is required, not just when a variable is being created.
1 parent f94bd1d commit c1e1659

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

Diff for: src/cxoVar.c

+5-11
Original file line numberDiff line numberDiff line change
@@ -357,17 +357,11 @@ cxoVar *cxoVar_newByType(cxoCursor *cursor, PyObject *value,
357357
return (cxoVar*) value;
358358
}
359359

360-
// everything else ought to be a Python type
361-
if (PyType_Check(value)) {
362-
varType = cxoVarType_fromPythonType(value, &objType);
363-
if (!varType)
364-
return NULL;
365-
return cxoVar_new(cursor, numElements, varType, varType->size, 0,
366-
objType);
367-
}
368-
369-
PyErr_SetString(PyExc_TypeError, "expecting type");
370-
return NULL;
360+
// everything else ought to be a Python type or object type
361+
varType = cxoVarType_fromPythonType(value, &objType);
362+
if (!varType)
363+
return NULL;
364+
return cxoVar_new(cursor, numElements, varType, varType->size, 0, objType);
371365
}
372366

373367

0 commit comments

Comments
 (0)