summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2019-11-23 18:23:00 +0100
committerLukas Fleischer <lfleischer@archlinux.org>2019-11-23 18:30:08 +0100
commit4b97789bab8dae01987ffa4cdeb1e1257c95834f (patch)
tree0df4da83aca2ee234c7e649c9d10f59cfc3ad828
parent882c011e745d65b7615ebec3628beef6ea867a04 (diff)
downloadaur-4b97789bab8dae01987ffa4cdeb1e1257c95834f.tar.gz
aur-4b97789bab8dae01987ffa4cdeb1e1257c95834f.tar.xz
Don't require all Python database modules to be installed
We support multiple database backends. Don't require Python modules for all backends to be installed. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
-rw-r--r--aurweb/db.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/aurweb/db.py b/aurweb/db.py
index 0b581970..c6d4de11 100644
--- a/aurweb/db.py
+++ b/aurweb/db.py
@@ -1,5 +1,12 @@
-import mysql.connector
-import sqlite3
+try:
+ import mysql.connector
+except ImportError:
+ pass
+
+try:
+ import sqlite3
+except ImportError:
+ pass
import aurweb.config