offshoot icon indicating copy to clipboard operation
offshoot copied to clipboard

Printing module import errors

Open codetorex opened this issue 8 years ago • 0 comments

base.py has

def map_pluggable_classes(config):
    pluggable_classes = dict()

    for m in config.get("modules"):
        try:
            exec("import %s" % m)
            classes = inspect.getmembers(sys.modules[m], inspect.isclass)

            for c in classes:
                if not issubclass(c[1], Pluggable):
                    continue

                pluggable_classes[c[0]] = c[1]
        except ImportError:
            warnings.warn("'%s' does not appear to be a valid module. Skipping!" % m)

If there is error occurs during a plugin import, they are not shown. Which makes it harder to look for a solution. It would be cool if it can inform user what is the problem with import. Thanks 👍

codetorex avatar Sep 15 '17 18:09 codetorex