-
Notifications
You must be signed in to change notification settings - Fork 47
Closed
python/mypy
#20393Labels
crashFailing compile-time asserts, unhandled exceptions, or generated C code that's blowing up.Failing compile-time asserts, unhandled exceptions, or generated C code that's blowing up.
Description
Using async with on an instance of a compiled class fails with the error above after wrappers for async functions with the CO_COROUTINE flag were added in python/mypy@81eaa5d.
To reproduce:
Compile test.py mypyc test.py
import asyncio
class Manager:
async def __aenter__(self) -> None:
await asyncio.sleep(0)
async def __aexit__(self, exc_type: object, exc: object, tb: object) -> None:
await asyncio.sleep(0)
async def test():
ctx = Manager()
async with ctx:
print("test")
asyncio.run(test())
Run python -c 'import test'
Metadata
Metadata
Assignees
Labels
crashFailing compile-time asserts, unhandled exceptions, or generated C code that's blowing up.Failing compile-time asserts, unhandled exceptions, or generated C code that's blowing up.