diff options
author | Gerhard Häring <gh@ghaering.de> | 2007-08-10 18:15:11 (GMT) |
---|---|---|
committer | Gerhard Häring <gh@ghaering.de> | 2007-08-10 18:15:11 (GMT) |
commit | 6d21456137836b8acd551cf6a51999ad4ff10a91 (patch) | |
tree | a9cdbf533531b1326623f704e6155350dddb0b17 /Modules/_sqlite/connection.c | |
parent | bd4a63e091ddb38a2d55d9c21eee8656863240ca (diff) | |
download | cpython-6d21456137836b8acd551cf6a51999ad4ff10a91.zip cpython-6d21456137836b8acd551cf6a51999ad4ff10a91.tar.gz cpython-6d21456137836b8acd551cf6a51999ad4ff10a91.tar.bz2 |
Make the sqlite tests pass.
Diffstat (limited to 'Modules/_sqlite/connection.c')
-rw-r--r-- | Modules/_sqlite/connection.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c index add2e6f..41b94aa 100644 --- a/Modules/_sqlite/connection.c +++ b/Modules/_sqlite/connection.c @@ -435,10 +435,8 @@ 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)) { - stringval = PyUnicode_AsUTF8String(py_val); if (stringval) { - sqlite3_result_text(context, PyString_AsString(stringval), -1, SQLITE_TRANSIENT); - Py_DECREF(stringval); + sqlite3_result_text(context, PyUnicode_AsString(stringval), -1, SQLITE_TRANSIENT); } } else { /* TODO: raise error */ @@ -1094,7 +1092,7 @@ pysqlite_connection_create_collation(pysqlite_Connection* self, PyObject* args) goto finally; } - if (!PyArg_ParseTuple(args, "O!O:create_collation(name, callback)", &PyString_Type, &name, &callable)) { + if (!PyArg_ParseTuple(args, "O!O:create_collation(name, callback)", &PyUnicode_Type, &name, &callable)) { goto finally; } |