From 36aee6f78767fa14baac4700baec4275baf26e6a Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Fri, 5 Mar 2021 19:00:26 +0100 Subject: [PATCH] The same applies to procedures - don't dump context as a JSON in case of exceptions --- platypush/procedure/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/platypush/procedure/__init__.py b/platypush/procedure/__init__.py index 66ca54bbb5..cd207aa1f1 100644 --- a/platypush/procedure/__init__.py +++ b/platypush/procedure/__init__.py @@ -1,5 +1,4 @@ import enum -import json import logging import re from functools import wraps @@ -345,7 +344,7 @@ class WhileProcedure(LoopProcedure): context[k] = eval('"{}"'.format(re.sub(r'(^|[^\\])"', '\1\\"', v))) except Exception as e: logger.warning('Could not parse value for context variable {}={}'.format(k, v)) - logger.warning('Context: {}'.format(json.dumps(context))) + logger.warning('Context: {}'.format(context)) logger.exception(e) return context @@ -460,7 +459,7 @@ class IfProcedure(Procedure): exec('{}="{}"'.format(k, re.sub(r'(^|[^\\])"', '\1\\"', v))) except Exception as e: logger.warning('Could not set context variable {}={}'.format(k, v)) - logger.warning('Context: {}'.format(json.dumps(context))) + logger.warning('Context: {}'.format(context)) logger.exception(e) condition_true = eval(self.condition)