summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2021-06-29 08:27:04 (GMT)
committerGitHub <noreply@github.com>2021-06-29 08:27:04 (GMT)
commit20a88004bae8ead66a205a125e1fe979376fc3ea (patch)
tree6b8007ba8c981cfdb52cc0a674e0491588ab50e0 /Misc
parent48e3a1d95aee013974121fcafe19816c0e9a41da (diff)
downloadcpython-20a88004bae8ead66a205a125e1fe979376fc3ea.zip
cpython-20a88004bae8ead66a205a125e1fe979376fc3ea.tar.gz
cpython-20a88004bae8ead66a205a125e1fe979376fc3ea.tar.bz2
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.
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2021-06-20-10-53-21.bpo-12022.SW240M.rst4
1 files changed, 4 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-06-20-10-53-21.bpo-12022.SW240M.rst b/Misc/NEWS.d/next/Core and Builtins/2021-06-20-10-53-21.bpo-12022.SW240M.rst
new file mode 100644
index 0000000..98c4228
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2021-06-20-10-53-21.bpo-12022.SW240M.rst
@@ -0,0 +1,4 @@
+A :exc:`TypeError` is now raised instead of an :exc:`AttributeError` in
+:keyword:`with` and :keyword:`async with` statements for objects which do
+not support the :term:`context manager` or :term:`asynchronous context
+manager` protocols correspondingly.