Backport 60334:
authorNeal Norwitz <nnorwitz@gmail.com>
Sun, 27 Jan 2008 01:23:50 +0000 (01:23 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Sun, 27 Jan 2008 01:23:50 +0000 (01:23 +0000)
On some systems (e.g., Ubuntu on hppa) the flush()
doesn't (always) cause the exception, but the close() does.

Lib/test/test_resource.py

index 29ce35bb0b39b0484686a6cec7f709aa257294d5..28876e3a211b5836a5b3ceb69decefe7a814b02f 100644 (file)
@@ -36,6 +36,9 @@ try:
     try:
         f.write("Y")
         f.flush()
+        # On some systems (e.g., Ubuntu on hppa) the flush()
+        # doesn't cause the exception, but the close() does.
+        f.close()
     except IOError:
         if not limit_set:
             raise