[Jython-checkins] jython: Error during io.*.close() should result in not closed

jeff.allen jython-checkins at python.org
Fri Mar 22 23:59:26 CET 2013


http://hg.python.org/jython/rev/e6c8d0ee43d3
changeset:   7100:e6c8d0ee43d3
user:        Jeff Allen <ja...py at farowl.co.uk>
date:        Sun Mar 17 17:28:53 2013 +0000
summary:
  Error during io.*.close() should result in not closed
test_io now down to 87 skips.

files:
  Lib/_jyio.py        |  8 ++++++--
  Lib/test/test_io.py |  1 -
  2 files changed, 6 insertions(+), 3 deletions(-)


diff --git a/Lib/_jyio.py b/Lib/_jyio.py
--- a/Lib/_jyio.py
+++ b/Lib/_jyio.py
@@ -227,7 +227,9 @@
     def raw(self):
         return self._raw
 
-    # Jython difference: @property closed(self) inherited from _IOBase.__closed
+    @property
+    def closed(self):
+        return self.raw.closed
 
     # Jython difference: emulate C implementation CHECK_INITIALIZED. This is for
     # compatibility, to pass test.test_io.CTextIOWrapperTest.test_initialization.
@@ -1108,7 +1110,9 @@
             finally:
                 self.buffer.close()
 
-    # Jython difference: @property closed(self) inherited from _IOBase.__closed
+    @property
+    def closed(self):
+        return self.buffer.closed
 
     # Jython difference: emulate C implementation CHECK_INITIALIZED. This is for
     # compatibility, to pass test.test_io.CTextIOWrapperTest.test_initialization.
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -770,7 +770,6 @@
         self.assertRaises(IOError, b.close) # exception not swallowed
         self.assertTrue(b.closed)
 
-    @unittest.skipIf(support.is_jython, "FIXME: by redefinition of closed")
     def test_close_error_on_close(self):
         raw = self.MockRawIO()
         def bad_flush():

-- 
Repository URL: http://hg.python.org/jython


More information about the Jython-checkins mailing list