mirror of
https://github.com/python/cpython.git
synced 2026-01-07 07:52:29 +00:00
merge
This commit is contained in:
commit
fa4ed0c145
1 changed files with 1 additions and 1 deletions
|
|
@ -371,7 +371,7 @@ some of the context managers being optional::
|
|||
with ExitStack() as stack:
|
||||
for resource in resources:
|
||||
stack.enter_context(resource)
|
||||
if need_special resource:
|
||||
if need_special_resource():
|
||||
special = acquire_special_resource()
|
||||
stack.callback(release_special_resource, special)
|
||||
# Perform operations that use the acquired resources
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue