summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-09-22 19:50:27 +0000
committerZac Medico <zmedico@gentoo.org>2006-09-22 19:50:27 +0000
commit79db37d777c2c3d6ae81bcb647bf395350f217fe (patch)
tree80991af98205dde1f793ac98e01a7d21b919a164
parentf98d48b871f7edac527f8d8b59bbe6aacaf7a069 (diff)
downloadportage-79db37d777c2c3d6ae81bcb647bf395350f217fe.tar.gz
portage-79db37d777c2c3d6ae81bcb647bf395350f217fe.tar.bz2
portage-79db37d777c2c3d6ae81bcb647bf395350f217fe.zip
Allow cache.sqlite to use sqlite3 from python-2.5, if available.
svn path=/main/trunk/; revision=4498
-rw-r--r--pym/cache/sqlite.py5
1 files changed, 4 insertions, 1 deletions
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):