From a6339de159b2e115b9c02bb3211213150db852c1 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Wed, 22 Aug 2018 02:32:53 +0200 Subject: [PATCH] Assigning plugins[plugin_name] inside of the synchronized block --- platypush/context/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/platypush/context/__init__.py b/platypush/context/__init__.py index e701a0c6c..f64a73047 100644 --- a/platypush/context/__init__.py +++ b/platypush/context/__init__.py @@ -97,13 +97,12 @@ def get_plugin(plugin_name, reload=False): plugin_class = getattr(plugin, cls_name) with plugins_init_locks[plugin_name]: - plugin = plugin_class(**plugin_conf) + plugins[plugin_name] = plugin_class(**plugin_conf) except AttributeError as e: logger.warning('No such class in {}: {}'.format(plugin_name, cls_name)) raise RuntimeError(e) - plugins[plugin_name] = plugin - return plugin + return plugins[plugin_name] def get_bus(): global main_bus