From 3d7755159f29423b20459a32d7db1d48b257fa85 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 30 Apr 2023 00:38:17 +0200 Subject: [PATCH] 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. --- platypush/plugins/entities/__init__.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/platypush/plugins/entities/__init__.py b/platypush/plugins/entities/__init__.py index 647f9f306..a21181d71 100644 --- a/platypush/plugins/entities/__init__.py +++ b/platypush/plugins/entities/__init__.py @@ -153,7 +153,14 @@ class EntitiesPlugin(Plugin): self.logger.warning( '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: results.append(result) except Empty: