Changeset - 0e5926e84b3b
[Not reviewed]
default
0 1 0
Mads Kiilerich - 6 years ago 2019-05-26 23:25:04
mads@kiilerich.com
Grafted from: 0048d591b925
vcs: drop exceptionhandling in utils.imports.import_class - it is over-engineered and just make debugging harder
1 file changed with 1 insertions and 7 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/vcs/utils/imports.py
Show inline comments
 
@@ -13,15 +13,9 @@ def import_class(class_path):
 
        except VCSError:
 
            # handle error
 
    """
 
    splitted = class_path.split('.')
 
    mod_path = '.'.join(splitted[:-1])
 
    class_name = splitted[-1]
 
    try:
 
        class_mod = __import__(mod_path, {}, {}, [class_name])
 
    except ImportError as err:
 
        msg = "There was problem while trying to import backend class. " \
 
            "Original error was:\n%s" % err
 
        raise VCSError(msg)
 
    class_mod = __import__(mod_path, {}, {}, [class_name])
 
    cls = getattr(class_mod, class_name)
 

	
 
    return cls
0 comments (0 inline, 0 general)