]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-44471: Change error type for bad objects in ExitStack.enter_context() (GH-26820)
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 29 Jun 2021 08:28:15 +0000 (11:28 +0300)
committerGitHub <noreply@github.com>
Tue, 29 Jun 2021 08:28:15 +0000 (11:28 +0300)
commit6cb145d23f5cf69b6d7414877d142747cd3d134c
tree0617efcd6911c14a1b8003bb9bee5fc68e521103
parent20a88004bae8ead66a205a125e1fe979376fc3ea
bpo-44471: Change error type for bad objects in ExitStack.enter_context() (GH-26820)

A TypeError is now raised instead of an AttributeError in
ExitStack.enter_context() and AsyncExitStack.enter_async_context()
for objects which do not support the context manager or
asynchronous context manager protocols correspondingly.
Doc/library/contextlib.rst
Doc/whatsnew/3.11.rst
Lib/contextlib.py
Lib/test/test_contextlib.py
Lib/test/test_contextlib_async.py
Misc/NEWS.d/next/Library/2021-06-21-10-46-58.bpo-44471.2QjXv_.rst [new file with mode: 0644]