From: Zac Medico Date: Fri, 22 Sep 2006 19:50:27 +0000 (-0000) Subject: Allow cache.sqlite to use sqlite3 from python-2.5, if available. X-Git-Tag: v2.1.1-r1~38 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=79db37d777c2c3d6ae81bcb647bf395350f217fe;p=portage.git Allow cache.sqlite to use sqlite3 from python-2.5, if available. svn path=/main/trunk/; revision=4498 --- diff --git a/pym/cache/sqlite.py b/pym/cache/sqlite.py index 78d4cd649..40b0b9a9e 100644 --- a/pym/cache/sqlite.py +++ b/pym/cache/sqlite.py @@ -9,7 +9,10 @@ from cache.mappings import LazyLoad, ProtectedDict from cache.template import reconstruct_eclasses from portage_util import writemsg, apply_secpass_permissions from portage_data import portage_gid -from pysqlite2 import dbapi2 as db_module +try: + import sqlite3 as db_module # sqlite3 is optional with >=python-2.5 +except ImportError: + from pysqlite2 import dbapi2 as db_module DBError = db_module.Error class database(fs_template.FsBased):