]> git.mxchange.org Git - quix0rs-apt-p2p.git/commitdiff
Make khashmir's db backwards compatible to pysqlite 2.0.x
authorCameron Dale <camrdale@gmail.com>
Fri, 11 Jan 2008 22:58:18 +0000 (14:58 -0800)
committerCameron Dale <camrdale@gmail.com>
Fri, 11 Jan 2008 22:58:18 +0000 (14:58 -0800)
apt_dht_Khashmir/db.py

index bea40dbef0db15babe95000af281d1944e98614d..8bb499e14512e85b0218941b22485ba0dac63474 100644 (file)
@@ -28,7 +28,11 @@ class DB:
             self._createNewDB(db)
         else:
             self._loadDB(db)
-        self.conn.text_factory = str
+        if sqlite.version_info < (2, 1):
+            sqlite.register_converter("TEXT", str)
+            sqlite.register_converter("text", str)
+        else:
+            self.conn.text_factory = str
         
     def _loadDB(self, db):
         try: