From b63843a13092f6346dec4c10b586b3053eef5c6f Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Fri, 12 Jul 2019 01:45:27 +0200 Subject: [PATCH] Fixed assistant event constructor with new Google plugins structure --- platypush/message/event/assistant/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/platypush/message/event/assistant/__init__.py b/platypush/message/event/assistant/__init__.py index 22a3e00058..531192977f 100644 --- a/platypush/message/event/assistant/__init__.py +++ b/platypush/message/event/assistant/__init__.py @@ -1,7 +1,7 @@ import logging import re -from platypush.context import get_backend +from platypush.context import get_backend, get_plugin from platypush.message.event import Event, EventMatchResult logger = logging.getLogger(__name__) @@ -14,11 +14,11 @@ class AssistantEvent(Event): super().__init__(*args, **kwargs) try: self._assistant = get_backend('assistant.google') - except KeyError as e: + except KeyError: try: - self._assistant = get_backend('assistant.google.pushtotalk') - except KeyError as e: - logger.warning('google.assistant backend not configured/initialized') + self._assistant = get_plugin('assistant.google.pushtotalk') + except Exception: + logger.warning('google.assistant not configured/initialized') self._assistant = None