summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2018-03-26 07:54:13 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2018-07-25 08:14:25 (GMT)
commitfe718e1159027e48daa3cfdbaace46acc4fb9575 (patch)
treed6c013b1217056bc74d1620f576480822d4d0e6f
parent79735f6418dd3c130cfcd28133e973f455baa1c9 (diff)
downloadeopayment-fe718e1159027e48daa3cfdbaace46acc4fb9575.zip
eopayment-fe718e1159027e48daa3cfdbaace46acc4fb9575.tar.gz
eopayment-fe718e1159027e48daa3cfdbaace46acc4fb9575.tar.bz2
python3: use importlib.import_module to import backends
-rw-r--r--eopayment/__init__.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/eopayment/__init__.py b/eopayment/__init__.py
index 1f6d89c..fbd0e55 100644
--- a/eopayment/__init__.py
+++ b/eopayment/__init__.py
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
+import importlib
import logging
from .common import (URL, HTML, FORM, RECEIVED, ACCEPTED, PAID, DENIED,
@@ -23,7 +24,7 @@ logger = logging.getLogger(__name__)
def get_backend(kind):
'''Resolve a backend name into a module object'''
- module = __import__(kind, globals(), locals(), [])
+ module = importlib.import_module('.' + kind, package='eopayment')
return module.Payment
__BACKENDS = [ DUMMY, SIPS, SIPS2, SYSTEMPAY, SPPLUS, OGONE, PAYBOX, PAYZEN, TIPI ]