From ce511e2fb717124324394039edba50063f9d071c Mon Sep 17 00:00:00 2001 From: Anthony Tuininga Date: Mon, 29 Apr 2019 11:40:48 -0600 Subject: [PATCH] Raise an exception when an error takes place (https://github.com/oracle/python-cx_Oracle/issues/299). --- src/cxoTransform.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cxoTransform.c b/src/cxoTransform.c index bdd8ad7..ddc190e 100644 --- a/src/cxoTransform.c +++ b/src/cxoTransform.c @@ -246,7 +246,9 @@ int cxoTransform_fromPython(cxoTransformNum transformNum, PyObject *pyValue, status = dpiLob_setFromBytes(dbValue->asLOB, buffer->ptr, buffer->size); Py_END_ALLOW_THREADS - return status; + if (status < 0) + return cxoError_raiseAndReturnInt(); + return 0; case CXO_TRANSFORM_NATIVE_INT: #if PY_MAJOR_VERSION < 3 if (PyInt_Check(pyValue)) {