From 2463b270e5990f9f89377591df18ab9ff2f2f19a Mon Sep 17 00:00:00 2001 From: andvikt Date: Fri, 22 Jul 2022 10:08:37 +0300 Subject: [PATCH] fix asyncio.lock --- custom_components/mega/tools.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/custom_components/mega/tools.py b/custom_components/mega/tools.py index aab64b7..5c4c63e 100644 --- a/custom_components/mega/tools.py +++ b/custom_components/mega/tools.py @@ -50,6 +50,10 @@ class PriorityLock(asyncio.Lock): finally: self.release() + @property + def _loop(self): + return asyncio.get_event_loop() + async def acquire(self, priority=0) -> bool: """Acquire a lock.