diff options
-rw-r--r-- | portato/db/__init__.py | 9 |
1 files changed, 7 insertions, 2 deletions
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) |