From d5a935928f2d95c6ab409f72bab3ce59c5933b98 Mon Sep 17 00:00:00 2001 From: Michael Kleehammer Date: Fri, 13 Oct 2023 11:47:59 -0500 Subject: [PATCH] attrs_before: Add error for unknown type --- src/connection.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/connection.cpp b/src/connection.cpp index c3da298a..d459bf4d 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -147,6 +147,12 @@ static bool ApplyPreconnAttrs(HDBC hdbc, SQLINTEGER ikey, PyObject *value, char } return true; } + else + { + RaiseErrorV(0, PyExc_TypeError, "Unsupported attrs_before type: %s", + Py_TYPE(value)->tp_name); + return false; + } Py_BEGIN_ALLOW_THREADS ret = SQLSetConnectAttrW(hdbc, ikey, ivalue, vallen);