diff options
author | Barry Warsaw <barry@python.org> | 2013-05-10 11:36:23 -0400 |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2013-05-10 11:36:23 -0400 |
commit | d4b5836722dea7c62470f514c72909e3678d664e (patch) | |
tree | 8c7a9975c29b380273f17131acdccea2ffdee79b /Doc/library/contextlib.rst | |
parent | 1697e1a08936741e06b44819003c04bb4dd3b3ba (diff) | |
parent | 6c4c6c5718a75c9a7df23e9c7420eeae1f9097c5 (diff) | |
download | cpython-d4b5836722dea7c62470f514c72909e3678d664e.tar.gz |
Merge 3.3
Diffstat (limited to 'Doc/library/contextlib.rst')
-rw-r--r-- | Doc/library/contextlib.rst | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Doc/library/contextlib.rst b/Doc/library/contextlib.rst index 86c3ab0286..349b805f3d 100644 --- a/Doc/library/contextlib.rst +++ b/Doc/library/contextlib.rst @@ -279,11 +279,12 @@ Functions and classes provided: with ExitStack() as stack: files = [stack.enter_context(open(fname)) for fname in filenames] - close_files = stack.pop_all().close() + # Hold onto the close method, but don't call it yet. + close_files = stack.pop_all().close # If opening any file fails, all previously opened files will be # closed automatically. If all files are opened successfully, # they will remain open even after the with statement ends. - # close_files() can then be invoked explicitly to close them all + # close_files() can then be invoked explicitly to close them all. .. method:: close() |