From: Cameron Dale Date: Fri, 11 Jan 2008 22:58:18 +0000 (-0800) Subject: Make khashmir's db backwards compatible to pysqlite 2.0.x X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ad6a6d5368f03482add4394182f284751c7e5bda;p=quix0rs-apt-p2p.git Make khashmir's db backwards compatible to pysqlite 2.0.x --- diff --git a/apt_dht_Khashmir/db.py b/apt_dht_Khashmir/db.py index bea40db..8bb499e 100644 --- a/apt_dht_Khashmir/db.py +++ b/apt_dht_Khashmir/db.py @@ -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: