Drop workaround for Python 3.8
... because now it is no longer supported. Change-Id: I494e4ddb34109a4ed001a39dac55652ab82eaf5d
This commit is contained in:
parent
de2c17447a
commit
dbc298b4cc
@ -18,17 +18,8 @@ LOG = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
def log_fail_msg(manager, entrypoint, exception):
|
def log_fail_msg(manager, entrypoint, exception):
|
||||||
# importlib.metadata in Python 3.8 is quite old and the EntryPoint class
|
LOG.warning('Encountered exception while loading %(module_name)s: '
|
||||||
# does not have module. This logic is required to workaround AttributeError
|
'"%(message)s". Not using %(name)s.',
|
||||||
# caused by that old implementation.
|
{'module_name': entrypoint.module,
|
||||||
if hasattr(entrypoint, 'module'):
|
'message': getattr(exception, 'message', str(exception)),
|
||||||
LOG.warning('Encountered exception while loading %(module_name)s: '
|
'name': entrypoint.name})
|
||||||
'"%(message)s". Not using %(name)s.',
|
|
||||||
{'module_name': entrypoint.module,
|
|
||||||
'message': getattr(exception, 'message', str(exception)),
|
|
||||||
'name': entrypoint.name})
|
|
||||||
else:
|
|
||||||
LOG.warning('Encountered exception: "%(message)s". '
|
|
||||||
'Not using %(name)s.',
|
|
||||||
{'message': getattr(exception, 'message', str(exception)),
|
|
||||||
'name': entrypoint.name})
|
|
||||||
|
Loading…
Reference in New Issue
Block a user