summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2013-05-10 15:36:23 (GMT)
committerBarry Warsaw <barry@python.org>2013-05-10 15:36:23 (GMT)
commit8c01ffa6ede5da92ab144ad2ea609a96e308b1e6 (patch)
tree521867d1ee6fe4a57ce84418cc4a98bedcee8973 /Doc
parent9b149b94ffdc455e76b84aedd202252f63f9e654 (diff)
parentd8f870d0faad949fa6ad073d35bc45ebf7074452 (diff)
downloadcpython-8c01ffa6ede5da92ab144ad2ea609a96e308b1e6.zip
cpython-8c01ffa6ede5da92ab144ad2ea609a96e308b1e6.tar.gz
cpython-8c01ffa6ede5da92ab144ad2ea609a96e308b1e6.tar.bz2
Merge 3.3
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/contextlib.rst5
1 files changed, 3 insertions, 2 deletions
diff --git a/Doc/library/contextlib.rst b/Doc/library/contextlib.rst
index 86c3ab0..349b805 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()