mirror of
https://github.com/meshcore-dev/meshcore_py.git
synced 2026-04-20 22:13:49 +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:
parent
b4cd5840ab
commit
1b404221a2
1 changed files with 1 additions and 1 deletions
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue