Thomas Grainger <tagr...@gmail.com> added the comment:
or consider the trio version: ``` import logging import trio from contextlib import asynccontextmanager @asynccontextmanager async def foo(): await trio.sleep(1) yield async def test(): async with trio.open_nursery() as n: f = foo() n.start_soon(f.__aenter__) n.start_soon(f.__aenter__) trio.run(test) ``` ``` Traceback (most recent call last): File "/home/graingert/projects/examples/bar.py", line 17, in <module> trio.run(test) File "/home/graingert/.virtualenvs/testing39/lib/python3.9/site-packages/trio/_core/_run.py", line 1932, in run raise runner.main_task_outcome.error File "/home/graingert/projects/examples/bar.py", line 15, in test n.start_soon(f.__aenter__) File "/home/graingert/.virtualenvs/testing39/lib/python3.9/site-packages/trio/_core/_run.py", line 815, in __aexit__ raise combined_error_from_nursery File "/usr/lib/python3.9/contextlib.py", line 179, in __aenter__ del self.args, self.kwds, self.func AttributeError: args ``` ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue45996> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com