Improved compatibility for traceback.format_exception.

The new syntax, that only requires an `Exception` instance to be passed
to the function, is only compatible with Python >= 3.10.
This commit is contained in:
Fabio Manganiello 2023-04-30 00:38:17 +02:00
parent 12cca4991a
commit 3d7755159f
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -153,7 +153,14 @@ class EntitiesPlugin(Plugin):
self.logger.warning( self.logger.warning(
'Could not load results from plugin %s: %s', plugin_name, result 'Could not load results from plugin %s: %s', plugin_name, result
) )
self.logger.warning(''.join(format_exception(result)))
self.logger.warning(
''.join(
format_exception(
type(result), value=result, tb=result.__traceback__
)
)
)
else: else:
results.append(result) results.append(result)
except Empty: except Empty: