Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3aba37a

Browse files
committed
Merged revisions 80463 via svnmerge from
svn+ssh://svn.python.org/python/branches/py3k ................ r80463 | georg.brandl | 2010-04-25 12:19:53 +0200 (So, 25 Apr 2010) | 17 lines Merged revisions 80150,80460-80461 via svnmerge from svn+ssh://[email protected]/python/trunk ........ r80150 | r.david.murray | 2010-04-17 17:45:38 +0200 (Sa, 17 Apr 2010) | 2 lines Update link to Apple Publication Style guide. ........ r80460 | georg.brandl | 2010-04-25 12:16:00 +0200 (So, 25 Apr 2010) | 1 line #8528: fix typo. ........ r80461 | georg.brandl | 2010-04-25 12:17:27 +0200 (So, 25 Apr 2010) | 1 line #8522: use with statement instead of try-finally for file handling. ........ ................
1 parent c2203f9 commit 3aba37a

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

Doc/documenting/style.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,5 @@ Unix
6666
1970s.
6767

6868

69-
.. _Apple Publications Style Guide: http://developer.apple.com/documentation/UserExperience/Conceptual/APStyleGuide/APSG_2008.pdf
69+
.. _Apple Publications Style Guide: http://developer.apple.com/mac/library/documentation/UserExperience/Conceptual/APStyleGuide/APSG_2009.pdf
7070

Doc/howto/doanddont.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,8 @@ file would not be closed when an exception is raised until the handler finishes,
199199
and perhaps not at all in non-C implementations (e.g., Jython). ::
200200

201201
def get_status(file):
202-
fp = open(file)
203-
try:
202+
with open(file) as fp:
204203
return fp.readline()
205-
finally:
206-
fp.close()
207204

208205

209206
Using the Batteries

0 commit comments

Comments
 (0)