diff --git a/platypush/plugins/__init__.py b/platypush/plugins/__init__.py index 802a674ad..d4be190cc 100644 --- a/platypush/plugins/__init__.py +++ b/platypush/plugins/__init__.py @@ -126,7 +126,11 @@ class RunnablePlugin(Plugin): Stop the plugin. """ self._should_stop.set() - if self._thread and self._thread.is_alive(): + if ( + self._thread + and self._thread != threading.current_thread() + and self._thread.is_alive() + ): self.logger.info('Waiting for the plugin to stop') try: if self._thread: