]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-12022: Change error type for bad objects in "with" and "async with" (GH-26809)
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 29 Jun 2021 08:27:04 +0000 (11:27 +0300)
committerGitHub <noreply@github.com>
Tue, 29 Jun 2021 08:27:04 +0000 (11:27 +0300)
commit20a88004bae8ead66a205a125e1fe979376fc3ea
tree6b8007ba8c981cfdb52cc0a674e0491588ab50e0
parent48e3a1d95aee013974121fcafe19816c0e9a41da
bpo-12022: Change error type for bad objects in "with" and "async with" (GH-26809)

A TypeError is now raised instead of an AttributeError in
"with" and "async with" statements for objects which do not
support the context manager or asynchronous context manager
protocols correspondingly.
Doc/whatsnew/3.11.rst
Lib/test/test_contextlib.py
Lib/test/test_coroutines.py
Lib/test/test_with.py
Misc/NEWS.d/next/Core and Builtins/2021-06-20-10-53-21.bpo-12022.SW240M.rst [new file with mode: 0644]
Python/ceval.c