From a605fe5cad62027b064364cab6dc5ce349e5e17e Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Tue, 28 Aug 2007 23:28:52 -0700 Subject: [PATCH] storage: use sqlite from either python2.5's stdlib or the pysqlite2 package --- src/allmydata/storage.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 -- 2.45.2