# HG changeset patch # User Goffi # Date 1591002860 -7200 # Node ID 3ff952c042ae141115a5386911d2589b3f05614e # Parent 9057713ab1245090bf202f63a2caa3cbb7e7e1d6 tools (common/dynamic_import): log a warning if bridge can't be imported diff -r 9057713ab124 -r 3ff952c042ae sat/tools/common/dynamic_import.py --- a/sat/tools/common/dynamic_import.py Fri May 29 21:55:45 2020 +0200 +++ b/sat/tools/common/dynamic_import.py Mon Jun 01 11:14:20 2020 +0200 @@ -1,7 +1,6 @@ #!/usr/bin/env python3 - -# SàT: a XMPP +# SàT: an XMPP client # Copyright (C) 2009-2020 Jérôme Poisson (goffi@goffi.org) # This program is free software: you can redistribute it and/or modify @@ -20,6 +19,10 @@ """ tools dynamic import """ from importlib import import_module +from sat.core.log import getLogger + + +log = getLogger(__name__) def bridge(name, module_path="sat.bridge"): @@ -34,6 +37,7 @@ except ImportError: try: bridge_module = import_module(module_path + "." + name + "_bridge") - except ImportError: + except ImportError as e: + log.warning(f"Can't import bridge {name!r}: {e}") bridge_module = None return bridge_module