summaryrefslogtreecommitdiff
path: root/kvmd/inotify.py
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2023-05-04 12:37:05 +0300
committerMaxim Devaev <[email protected]>2023-05-04 12:37:05 +0300
commitb5353e63cd52b0d98e7a56acc5c8fbfc6ad8b3ee (patch)
tree3176f1a738b9533e6f3a28b132e4501a6f97f991 /kvmd/inotify.py
parentb5d67314977a7e475fac164446031ca7c83b8bc4 (diff)
python 3.11 fixes
Diffstat (limited to 'kvmd/inotify.py')
-rw-r--r--kvmd/inotify.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/kvmd/inotify.py b/kvmd/inotify.py
index b66ca443..c157c1ca 100644
--- a/kvmd/inotify.py
+++ b/kvmd/inotify.py
@@ -215,7 +215,10 @@ class Inotify:
async def get_event(self, timeout: float) -> (InotifyEvent | None):
assert timeout > 0
try:
- return (await asyncio.wait_for(self.__events_queue.get(), timeout=timeout))
+ return (await asyncio.wait_for(
+ asyncio.ensure_future(self.__events_queue.get()),
+ timeout=timeout,
+ ))
except asyncio.TimeoutError:
return None