From 6e69f7faa3b2423753960e9cb5132f81a9459951 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 10 Aug 2007 18:35:04 +0000 Subject: Fix a bit of code that wasn't converted properly, causing a segfault. --- Modules/_sqlite/connection.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c index 41b94aa..593dc1e 100644 --- a/Modules/_sqlite/connection.c +++ b/Modules/_sqlite/connection.c @@ -415,7 +415,6 @@ void _pysqlite_set_result(sqlite3_context* context, PyObject* py_val) long longval; const char* buffer; Py_ssize_t buflen; - PyObject* stringval; if ((!py_val) || PyErr_Occurred()) { sqlite3_result_null(context); @@ -435,9 +434,7 @@ void _pysqlite_set_result(sqlite3_context* context, PyObject* py_val) } else if (PyString_Check(py_val)) { sqlite3_result_text(context, PyString_AsString(py_val), -1, SQLITE_TRANSIENT); } else if (PyUnicode_Check(py_val)) { - if (stringval) { - sqlite3_result_text(context, PyUnicode_AsString(stringval), -1, SQLITE_TRANSIENT); - } + sqlite3_result_text(context, PyUnicode_AsString(py_val), -1, SQLITE_TRANSIENT); } else { /* TODO: raise error */ } -- cgit v0.12