23 Nov
2019
23 Nov
'19
5:31 p.m.
We support multiple database backends. Don't require Python modules for all backends to be installed. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org> --- aurweb/db.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/aurweb/db.py b/aurweb/db.py index 0b58197..c6d4de1 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 -- 2.24.0