From b555777cc82b60da445bee7743f08077e681b55b Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Tue, 12 Feb 2019 20:49:10 +0100 Subject: [PATCH] Use another event loop for the synchronous websocket communication method --- platypush/backend/music/mopidy.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platypush/backend/music/mopidy.py b/platypush/backend/music/mopidy.py index 745a717ef..eccd8083b 100644 --- a/platypush/backend/music/mopidy.py +++ b/platypush/backend/music/mopidy.py @@ -109,8 +109,10 @@ class MusicMopidyBackend(Backend): response = response.decode() resp_queue.put(json.loads(response)) - loop = asyncio.get_event_loop() + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) loop.run_until_complete(get_response()) + loop.stop() return resp_queue.get().get('result') def _get_tracklist_status(self):