From a1122e14a6d2ace8907923507e7d31c44a6f7c68 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Fri, 14 Jun 2013 21:28:17 -0400 Subject: [PATCH] Fixed #20604 - Fixed file example in docs. Thanks Chris Lasher for the report. --- docs/topics/files.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/topics/files.txt b/docs/topics/files.txt index 492e6a20b59..45f83d8746e 100644 --- a/docs/topics/files.txt +++ b/docs/topics/files.txt @@ -87,9 +87,9 @@ The following approach may be used to close files automatically:: # Create a Python file object using open() and the with statement >>> with open('/tmp/hello.world', 'w') as f: - >>> myfile = File(f) - >>> for line in myfile: - >>> print line + ... myfile = File(f) + ... myfile.write('Hello World') + ... >>> myfile.closed True >>> f.closed