]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
storage: use sqlite from either python2.5's stdlib or the pysqlite2 package
authorBrian Warner <warner@lothar.com>
Wed, 29 Aug 2007 06:28:52 +0000 (23:28 -0700)
committerBrian Warner <warner@lothar.com>
Wed, 29 Aug 2007 06:28:52 +0000 (23:28 -0700)
src/allmydata/storage.py

index e2af4fd90f2c2ffdd8c231610e86deda23c0e0dd..1d1a60a08e02d8893917a14f71549c6926926249 100644 (file)
@@ -11,7 +11,14 @@ from allmydata.interfaces import RIStorageServer, RIBucketWriter, \
 from allmydata.util import fileutil, idlib, mathutil
 from allmydata.util.assertutil import precondition
 
-from pysqlite2 import dbapi2 as sqlite
+try:
+    # python2.5 ships with sqlite builtin
+    import sqlite3.dbapi2
+    sqlite = sqlite3.dbapi2
+except ImportError:
+    # for python2.4, it's installed under a different name
+    import pysqlite2.dbapi2
+    sqlite = pysqlite2.dbapi2
 
 # store/
 # store/owners.db