mirror of
https://github.com/meshcore-dev/meshcore_py.git
synced 2026-06-11 11:56:18 +00:00
G5: F19 — replace deprecated get_event_loop with get_running_loop
Why: asyncio.get_event_loop() inside an async function emits DeprecationWarning since Python 3.10 and raises in some contexts on Python 3.12+. The call in CommandHandlerBase.send() is always inside a running async context where get_running_loop() is the correct API. Refs: Forensics report finding F19
This commit is contained in:
@@ -185,7 +185,7 @@ class CommandHandlerBase:
|
||||
futures: List[asyncio.Future] = []
|
||||
subscriptions = []
|
||||
|
||||
loop = asyncio.get_event_loop()
|
||||
loop = asyncio.get_running_loop()
|
||||
for event_type in expected_events:
|
||||
future = loop.create_future()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user