[yum-cvs] yum-metadata-parser sqlitecachec.py,1.3,1.4

Jeremy Katz katzj at linux.duke.edu
Tue Dec 5 20:50:40 UTC 2006


Update of /home/groups/yum/cvs/yum-metadata-parser
In directory login1.linux.duke.edu:/tmp/cvs-serv25185

Modified Files:
	sqlitecachec.py 
Log Message:
support newer pysqlite as included in python 2.5


Index: sqlitecachec.py
===================================================================
RCS file: /home/groups/yum/cvs/yum-metadata-parser/sqlitecachec.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- sqlitecachec.py	23 Nov 2006 01:22:49 -0000	1.3
+++ sqlitecachec.py	5 Dec 2006 20:50:38 -0000	1.4
@@ -12,7 +12,10 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-import sqlite
+try:
+    import sqlite3 as sqlite
+except ImportError:
+    import sqlite
 import _sqlitecache
 
 class RepodataParserSqlite:
@@ -23,7 +26,10 @@
     def open_database(self, filename):
         if not filename:
             return None
-        return sqlite.connect(filename)
+        con = sqlite.connect(filename)
+        if sqlite.version_info[0] > 1:
+            con.row_factory = sqlite.Row
+        return con
 
     def getPrimary(self, location, checksum):
         """Load primary.xml.gz from an sqlite cache and update it 




More information about the Yum-cvs-commits mailing list