We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a7f08cd commit 2624a3eCopy full SHA for 2624a3e
src/viam/sessions_client.py
@@ -1,4 +1,5 @@
1
import asyncio
2
+import sys
3
from datetime import timedelta
4
from typing import Optional
5
@@ -29,8 +30,13 @@
29
30
)
31
32
33
+def loop_kwargs():
34
+ loop = asyncio.get_running_loop()
35
+ return {"loop": loop} if sys.version_info[:2] <= (3, 9) else {}
36
+
37
38
async def delay(coro, seconds):
- await asyncio.sleep(seconds)
39
+ await asyncio.sleep(seconds, **loop_kwargs())
40
await coro
41
42
@@ -42,7 +48,7 @@ class SessionsClient:
48
43
49
_current_id: str = ""
44
50
_disabled: bool = False
45
- _lock = asyncio.Lock()
51
+ _lock = asyncio.Lock(**loop_kwargs())
46
52
_supported: Optional[bool] = None
47
53
_heartbeat_interval: Optional[timedelta] = None
54
0 commit comments