From f67b737a54769a512b575c350f125698df469baf Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Thu, 7 Jun 2018 09:33:26 +0200 Subject: [PATCH] Best effort in context expansion --- platypush/message/request/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platypush/message/request/__init__.py b/platypush/message/request/__init__.py index fa04e49b..0ae83f32 100644 --- a/platypush/message/request/__init__.py +++ b/platypush/message/request/__init__.py @@ -106,7 +106,10 @@ class Request(Message): for (k, v) in context.items(): if isinstance(v, Message): v = json.loads(str(v)) - exec('{}={}'.format(k, v)) + try: + exec('{}={}'.format(k, v)) + except: + exec('{}="{}"'.format(k, v)) parsed_value = '' while value: