Skip to content

Commit 0418172

Browse files
committed
Fixing _get_running_loop
1 parent 56a4a63 commit 0418172

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

azure_functions_worker/dispatcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ def set_azure_invocation_id(self, invocation_id: str) -> None:
553553

554554

555555
def get_current_invocation_id() -> Optional[str]:
556-
loop = asyncio.events.get_running_loop()
556+
loop = asyncio._get_running_loop()
557557
if loop is not None:
558558
current_task = asyncio.Task.current_task(loop)
559559
if current_task is not None:

azure_functions_worker/testutils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ def __init__(self, scripts_dir):
453453
self._worker = None
454454

455455
async def __aenter__(self):
456-
loop = aio_compat.get_running_loop()
456+
loop = asyncio._get_running_loop()
457457
self._host = _MockWebHost(loop, self._scripts_dir)
458458

459459
await self._host.start()
@@ -468,7 +468,7 @@ async def __aenter__(self):
468468

469469
done, pending = await asyncio.wait([self._host._connected_fut,
470470
self._worker_task],
471-
return_when=asyncio.FIRST_COMPLETED)
471+
return_when=asyncio.FIRST_COMPLETED)
472472

473473
try:
474474
if self._worker_task in done:

0 commit comments

Comments
 (0)