Skip to content

mis-detects curio as asyncio when running in curio in asyncio.to_thread (py3.9) #20

@graingert

Description

@graingert
import curio
import sniffio
import asyncio

async def current_framework():
    return sniffio.current_async_library()


async def amain():
    sniffio.current_async_library()
    return await asyncio.to_thread(curio.run, current_framework)


print(asyncio.run(amain()))  # prints asyncio - should print curio

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions