]> granicus.if.org Git - python/commitdiff
On some systems (e.g., Ubuntu on hppa) the flush()
authorNeal Norwitz <nnorwitz@gmail.com>
Sat, 26 Jan 2008 23:13:46 +0000 (23:13 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Sat, 26 Jan 2008 23:13:46 +0000 (23:13 +0000)
doesn't cause the exception, but the close() does.

Will backport.

Lib/test/test_resource.py

index 09ac4d53ca7bb3313c90a2320def00b8e12c93fe..3ff31bb33dd5be97b1c0e7fc3ee1ced32e29f0a2 100644 (file)
@@ -53,6 +53,9 @@ class ResourceTest(unittest.TestCase):
                     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