summaryrefslogtreecommitdiffstats
path: root/Modules/_sqlite
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-08-10 18:35:04 (GMT)
committerGuido van Rossum <guido@python.org>2007-08-10 18:35:04 (GMT)
commit6e69f7faa3b2423753960e9cb5132f81a9459951 (patch)
tree3f8a6e9aff837c31003a7232b81c63eb05069f0b /Modules/_sqlite
parent6d21456137836b8acd551cf6a51999ad4ff10a91 (diff)
downloadcpython-6e69f7faa3b2423753960e9cb5132f81a9459951.zip
cpython-6e69f7faa3b2423753960e9cb5132f81a9459951.tar.gz
cpython-6e69f7faa3b2423753960e9cb5132f81a9459951.tar.bz2
Fix a bit of code that wasn't converted properly, causing a segfault.
Diffstat (limited to 'Modules/_sqlite')
-rw-r--r--Modules/_sqlite/connection.c5
1 files changed, 1 insertions, 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 */
}