From: Brian Warner Date: Wed, 29 Aug 2007 06:28:52 +0000 (-0700) Subject: storage: use sqlite from either python2.5's stdlib or the pysqlite2 package X-Git-Url: https://git.rkrishnan.org/architecture.txt?a=commitdiff_plain;h=a605fe5cad62027b064364cab6dc5ce349e5e17e;p=tahoe-lafs%2Ftahoe-lafs.git storage: use sqlite from either python2.5's stdlib or the pysqlite2 package --- diff --git a/src/allmydata/storage.py b/src/allmydata/storage.py index e2af4fd9..1d1a60a0 100644 --- a/src/allmydata/storage.py +++ b/src/allmydata/storage.py @@ -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