◐ Shell
reader mode source ↗
Skip to content

bpo-44471: Change error type for bad objects in ExitStack.enter_context()#26820

Merged
serhiy-storchaka merged 2 commits into
python:mainfrom
serhiy-storchaka:contextlib-type-error
Jun 29, 2021
Merged

bpo-44471: Change error type for bad objects in ExitStack.enter_context()#26820
serhiy-storchaka merged 2 commits into
python:mainfrom
serhiy-storchaka:contextlib-type-error

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jun 21, 2021

Copy link
Copy Markdown
Member

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.

https://bugs.python.org/issue44471

…xt()

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.
@serhiy-storchaka serhiy-storchaka merged commit 6cb145d into python:main Jun 29, 2021
@serhiy-storchaka serhiy-storchaka deleted the contextlib-type-error branch June 29, 2021 08:28
@JulienPalard

Copy link
Copy Markdown
Member

This was merged with travis and azure failing to build the doc due to trailing whitespaces:

$ (cd Doc; python3.6 tools/rstlint.py -i tools -i ./venv -i README.rst)
[1] whatsnew/3.11.rst:79: trailing whitespace
[1] whatsnew/3.11.rst:85: trailing whitespace
[1] whatsnew/3.11.rst:87: trailing whitespace
3 problems with severity 1 found.

why? (It cause other PR to fail due to this now)

@serhiy-storchaka

Copy link
Copy Markdown
Member Author

Thank you for fixing this @JulienPalard.

@JulienPalard

Copy link
Copy Markdown
Member

You're welcome, I tried to fix it before it impacted much PRs (only #24903 got impacted temporarily).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants