From ee5e4dff9201a1ed820fffe6f79311547e15ae0e Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Tue, 7 Aug 2018 21:52:07 +0000 Subject: [PATCH] Revert "In Python 3.7 async is a strict language keyword that can't be used for variables names - replaces occurrences with _async" This reverts commit f0577733b61ac67f60e9719a3018fb07488bc80f. --- platypush/message/request/__init__.py | 6 +++--- platypush/procedure/__init__.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/platypush/message/request/__init__.py b/platypush/message/request/__init__.py index 5c46ceef1..3ef9f3277 100644 --- a/platypush/message/request/__init__.py +++ b/platypush/message/request/__init__.py @@ -159,12 +159,12 @@ class Request(Message): 'origin attached: {}'.format(response)) - def execute(self, n_tries=1, _async=True, **context): + def execute(self, n_tries=1, async=True, **context): """ Execute this request and returns a Response object Params: n_tries -- Number of tries in case of failure before raising a RuntimeError - _async -- If True, the request will be run asynchronously and the + async -- If True, the request will be run asynchronously and the response posted on the bus when available (default), otherwise the current thread will wait for the response to be returned synchronously. @@ -212,7 +212,7 @@ class Request(Message): if self.token is None or get_hash(self.token) != token_hash: raise PermissionError() - if _async: + if async: Thread(target=_thread_func, args=(n_tries,)).start() else: return _thread_func(n_tries) diff --git a/platypush/procedure/__init__.py b/platypush/procedure/__init__.py index 20c230038..ba898cff9 100644 --- a/platypush/procedure/__init__.py +++ b/platypush/procedure/__init__.py @@ -108,7 +108,7 @@ class Procedure(object): context['async'] = self.async; context['n_tries'] = n_tries response = request.execute(**context) - if not self._async: + if not self.async: if isinstance(response.output, dict): for (k,v) in response.output.items(): context[k] = v