diff options
-rw-r--r-- | Doc/documenting/style.rst | 2 | ||||
-rw-r--r-- | Doc/howto/doanddont.rst | 5 |
2 files changed, 2 insertions, 5 deletions
diff --git a/Doc/documenting/style.rst b/Doc/documenting/style.rst index 593f6da..6145559 100644 --- a/Doc/documenting/style.rst +++ b/Doc/documenting/style.rst @@ -66,5 +66,5 @@ Unix 1970s. -.. _Apple Publications Style Guide: http://developer.apple.com/documentation/UserExperience/Conceptual/APStyleGuide/APSG_2008.pdf +.. _Apple Publications Style Guide: http://developer.apple.com/mac/library/documentation/UserExperience/Conceptual/APStyleGuide/APSG_2009.pdf diff --git a/Doc/howto/doanddont.rst b/Doc/howto/doanddont.rst index 989ae9f..5fe3015 100644 --- a/Doc/howto/doanddont.rst +++ b/Doc/howto/doanddont.rst @@ -199,11 +199,8 @@ file would not be closed when an exception is raised until the handler finishes, and perhaps not at all in non-C implementations (e.g., Jython). :: def get_status(file): - fp = open(file) - try: + with open(file) as fp: return fp.readline() - finally: - fp.close() Using the Batteries |