Message407817
you can see the analogous sync contextmanager issue on python3.6 with:
```
import logging
from contextlib import contextmanager
@contextmanager
def foo():
yield
def test():
f = foo()
f.__enter__()
f.__enter__()
test()
```
on python3.7+ you get the bpo-30306 behaviour
```
Traceback (most recent call last):
File "sync.py", line 14, in <module>
test()
File "sync.py", line 12, in test
f.__enter__()
File "/usr/lib/python3.8/contextlib.py", line 111, in __enter__
del self.args, self.kwds, self.func
AttributeError: args
```
and python3.6 you get the same sort of error you see now for asynccontextmanagers:
```
Traceback (most recent call last):
File "sync.py", line 14, in <module>
test()
File "sync.py", line 12, in test
f.__enter__()
File "/usr/lib/python3.6/contextlib.py", line 83, in __enter__
raise RuntimeError("generator didn't yield") from None
RuntimeError: generator didn't yield
``` |
|
Date |
User |
Action |
Args |
2021-12-06 14:34:48 | graingert | set | recipients:
+ graingert, ncoghlan, asvetlov, lukasz.langa, Dima.Tisnek, yselivanov |
2021-12-06 14:34:48 | graingert | set | messageid: <1638801288.26.0.325599068166.issue45996@roundup.psfhosted.org> |
2021-12-06 14:34:48 | graingert | link | issue45996 messages |
2021-12-06 14:34:48 | graingert | create | |
|