X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/6006a10232650fcd622af648036f2e8260ed2e17..fa21c2cc4d92e1f723a3b38daa2f033dbb4889e5:/forum/modules/__init__.py diff --git a/forum/modules/__init__.py b/forum/modules/__init__.py index f1ad7d9..6942c91 100644 --- a/forum/modules/__init__.py +++ b/forum/modules/__init__.py @@ -16,15 +16,10 @@ def get_modules_script(script_name): try: all.append(__import__('%s.%s' % (m.__name__, script_name), globals(), locals(), [m.__name__])) - except ImportError, e: - #print repr(type(e)) + m.__name__ + ":" + str(e) - pass - except: - import traceback - msg = "Error importing %s from module %s: \n %s" % ( - script_name, m, traceback.format_exc() - ) - logging.error(msg) + except Exception, e: + if isinstance(e, ImportError) and str(e).endswith(script_name): + continue + logging.exception("Error importing %s from module %s", script_name, m) return all