From 4796b5f7032bfa0423e7b7a152ebfb4226c9262c Mon Sep 17 00:00:00 2001 From: CoolCat467 <52022020+CoolCat467@users.noreply.github.com> Date: Thu, 21 Dec 2023 17:00:59 -0600 Subject: [PATCH] Partially fix #2908 --- src/trio/_core/_run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/trio/_core/_run.py b/src/trio/_core/_run.py index 1e37a7dbb2..c90989e560 100644 --- a/src/trio/_core/_run.py +++ b/src/trio/_core/_run.py @@ -1758,7 +1758,7 @@ def spawn_impl( except AttributeError: name = repr(name) - if not hasattr(coro, "cr_frame"): + if getattr(coro, "cr_frame", None) is None: # This async function is implemented in C or Cython async def python_wrapper(orig_coro: Awaitable[RetT]) -> RetT: return await orig_coro