Imported Debian patch 2.4.0-2 debian/2.4.0-2
authorJoel Rosdahl <joel@debian.org>
Wed, 5 Dec 2007 22:14:41 +0000 (23:14 +0100)
committerJoel Rosdahl <joel@debian.org>
Mon, 11 Jan 2010 20:41:50 +0000 (21:41 +0100)
debian/changelog
src/connection.c

index 698a854..efc7267 100644 (file)
@@ -1,3 +1,9 @@
+python-pysqlite2 (2.4.0-2) unstable; urgency=low
+
+  * Made Unicode string work as database parameter again. Closes: #454424.
+
+ -- Joel Rosdahl <joel@debian.org>  Wed, 05 Dec 2007 23:14:41 +0100
+
 python-pysqlite2 (2.4.0-1) unstable; urgency=low
 
   * New upstream release.
 python-pysqlite2 (2.4.0-1) unstable; urgency=low
 
   * New upstream release.
index 815595e..104ac01 100644 (file)
@@ -83,7 +83,7 @@ int pysqlite_connection_init(pysqlite_Connection* self, PyObject* args, PyObject
     Py_INCREF(&PyUnicode_Type);
     self->text_factory = (PyObject*)&PyUnicode_Type;
 
     Py_INCREF(&PyUnicode_Type);
     self->text_factory = (PyObject*)&PyUnicode_Type;
 
-    if (PyString_Check(database)) {
+    if (PyString_Check(database) || PyUnicode_Check(database)) {
         Py_BEGIN_ALLOW_THREADS
         rc = sqlite3_open(PyString_AsString(database), &self->db);
         Py_END_ALLOW_THREADS
         Py_BEGIN_ALLOW_THREADS
         rc = sqlite3_open(PyString_AsString(database), &self->db);
         Py_END_ALLOW_THREADS