Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions trio_asyncio/_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,6 @@ def set_event_loop(self, loop):
super().set_event_loop(loop)


# get_event_loop() without a running loop is deprecated in 3.12+. The logic for emitting the
# DeprecationWarning walks the stack looking at module names in order to associate it with
# the first caller outside asyncio. We need to pretend to be asyncio in order for that to work.
if sys.version_info >= (3, 12):
__name__ = "asyncio.fake.trio_asyncio._loop"

# Make sure we don't try to continue using the Trio loop after a fork()
if hasattr(os, "register_at_fork"):

Expand Down Expand Up @@ -687,3 +681,10 @@ def run_trio_task(proc, *args):
will propagate to, and terminate, the trio-asyncio loop.
"""
_running_loop().run_trio_task(proc, *args)


# get_event_loop() without a running loop is deprecated in 3.12+. The logic for emitting the
# DeprecationWarning walks the stack looking at module names in order to associate it with
# the first caller outside asyncio. We need to pretend to be asyncio in order for that to work.
if sys.version_info >= (3, 12):
__name__ = "asyncio.fake.trio_asyncio._loop"