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
Commit 98a5dd5
Browse filesBrowse the repository at this point in the historyBrowse files
gh-163064: Raise RuntimeError when reusing a contextmanager
Since gh-74492, _GeneratorContextManager.__enter__ and
_AsyncGeneratorContextManager.__aenter__ start by deleting self.args,
self.kwds and self.func. Entering the same context manager a second time
therefore failed with an AttributeError about an internal attribute
instead of the documented RuntimeError("generator didn't yield").
Raise that RuntimeError when the attributes are already gone, without
touching the generator, so that re-entering an active context manager
also doesn't advance the suspended generator.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
0 commit comments