You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Raise TypeError in ExitStack.enter_context() for bad argument #88637
bpo-12022: AttributeError should report the same details when raised by lookup_special() as when raised in the REPL
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2021-06-29.08:29:12.209>created_at=<Date2021-06-21.07:43:53.258>labels= ['type-feature', 'library', '3.11']
title='Raise TypeError in ExitStack.enter_context() for bad argument'updated_at=<Date2021-06-29.08:29:12.209>user='https://github.com/serhiy-storchaka'
For consistency with the "with" statement (see bpo-12022) ExitStack.enter_context() should raise TypeError instead of AttributeError if the argument is not a context manager. Same for AsyncExitStack.enter_async_context().
New changeset 6cb145d by Serhiy Storchaka in branch 'main': bpo-44471: Change error type for bad objects in ExitStack.enter_context() (GH-26820) 6cb145d
Activity
serhiy-storchaka commentedon Jun 21, 2021
For consistency with the "with" statement (see bpo-12022) ExitStack.enter_context() should raise TypeError instead of AttributeError if the argument is not a context manager. Same for AsyncExitStack.enter_async_context().
serhiy-storchaka commentedon Jun 29, 2021
New changeset 6cb145d by Serhiy Storchaka in branch 'main':
bpo-44471: Change error type for bad objects in ExitStack.enter_context() (GH-26820)
6cb145d