diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2007-07-29 21:36:04 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2007-07-29 21:36:04 +0000 |
commit | c61288c3c39bce491535cbf5dfed7708657fb158 (patch) | |
tree | 1c4292fc42bb3b16bdc466950b29a204a21e3d60 | |
parent | 7df69d4d53d7f17969825d34ea0a6bb1a0fd0aab (diff) | |
download | bitbake-c61288c3c39bce491535cbf5dfed7708657fb158.tar.gz |
persist_data.py: Try harder to import an sqlite package. Show how to change the connection lock timeout
-rw-r--r-- | lib/bb/persist_data.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/bb/persist_data.py b/lib/bb/persist_data.py index b00afe650..4df335a6a 100644 --- a/lib/bb/persist_data.py +++ b/lib/bb/persist_data.py @@ -20,7 +20,10 @@ import bb, os try: import sqlite3 except ImportError: - bb.msg.fatal(bb.msg.domain.PersistData, "Importing sqlite3 failed, please install it.") + try: + from pysqlite2 import dbapi2 as sqlite3 + except ImportError: + bb.msg.fatal(bb.msg.domain.PersistData, "Importing sqlite3 and pysqlite2 failed, please install one of them. A 'python-pysqlite2' like package is likely to be what you need.") class PersistData: """ @@ -47,7 +50,7 @@ class PersistData: self.cachefile = os.path.join(self.cachedir,"bb_persist_data.sqlite3") bb.msg.debug(1, bb.msg.domain.PersistData, "Using '%s' as the persistent data cache" % self.cachefile) - self.connection = sqlite3.connect(self.cachefile, isolation_level=None) + self.connection = sqlite3.connect(self.cachefile, timeout=5, isolation_level=None) def addDomain(self, domain): """ |