From 4bd0501d3f533ee4d2ef8ee425b8dd60131a5980 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Sat, 15 Aug 2009 00:46:21 +0200 Subject: Honor missing eix module --- portato/db/__init__.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'portato/db') diff --git a/portato/db/__init__.py b/portato/db/__init__.py index 9869e3f..a58ba61 100644 --- a/portato/db/__init__.py +++ b/portato/db/__init__.py @@ -50,8 +50,13 @@ def Database(type): elif type == "eixsql": debug("Using EixSQLDatabase") - from .eix_sql import EixSQLDatabase - return EixSQLDatabase(SectionDict(_SESSION, type)) + try: + from .eix_sql import EixSQLDatabase + except ImportError: + warning(_("Cannot load EixSQLDatabase.")) + return Database("sql") + else: + return EixSQLDatabase(SectionDict(_SESSION, type)) else: error(_("Unknown database type: %s"), type) -- cgit v1.2.3