import_module()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 4
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
try:
0 ignored issues
show
introduced by
Missing module docstring
Loading history...
2
    import logging
3
    import sys
4
    import importlib
5
except ImportError as err:
6
    logging.error('Error %s import module: %s', __name__, err)
7
    logging.exception('Exception occurred')
8
9
    sys.exit(128)
10
11
12
def import_module(module_name, class_name):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
13
    module = importlib.import_module(module_name)
14
    load_class = getattr(module, class_name)
15
    return load_class
16