This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author graingert
Recipients Dima.Tisnek, asvetlov, graingert, lukasz.langa, ncoghlan, yselivanov
Date 2021-12-06.14:18:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1638800302.87.0.584847308846.issue45996@roundup.psfhosted.org>
In-reply-to
Content
I think `AttributeError: args` is the desired/expected behaviour

consider the sync version:

```
import logging
from asyncio import sleep, gather, run
from contextlib import asynccontextmanager, contextmanager

@contextmanager
def foo():
    yield


def test():
    f = foo()
    f.__enter__()
    f.__enter__()

test()
```

```
Traceback (most recent call last):
  File "/home/graingert/projects/example/sync.py", line 15, in <module>
    test()
  File "/home/graingert/projects/example/sync.py", line 13, in test
    f.__enter__()
  File "/usr/lib/python3.9/contextlib.py", line 117, in __enter__
    del self.args, self.kwds, self.func
AttributeError: args
```
History
Date User Action Args
2021-12-06 14:18:22graingertsetrecipients: + graingert, ncoghlan, asvetlov, lukasz.langa, Dima.Tisnek, yselivanov
2021-12-06 14:18:22graingertsetmessageid: <1638800302.87.0.584847308846.issue45996@roundup.psfhosted.org>
2021-12-06 14:18:22graingertlinkissue45996 messages
2021-12-06 14:18:22graingertcreate