[Jython-checkins] jython: Ignore when ValueError replaces IOError on Jython for now.

frank.wierzbicki jython-checkins at python.org
Mon Jun 25 04:51:13 CEST 2012


http://hg.python.org/jython/rev/e77d0669145d
changeset:   6739:e77d0669145d
user:        Frank Wierzbicki <fwierzbicki at gmail.com>
date:        Sun Jun 24 11:16:52 2012 -0700
summary:
  Ignore when ValueError replaces IOError on Jython for now.

files:
  Lib/test/test_fileio.py |  22 +++++++++++++++++++++-
  1 files changed, 21 insertions(+), 1 deletions(-)


diff --git a/Lib/test/test_fileio.py b/Lib/test/test_fileio.py
--- a/Lib/test/test_fileio.py
+++ b/Lib/test/test_fileio.py
@@ -10,12 +10,19 @@
 from weakref import proxy
 from functools import wraps
 
-from test.test_support import TESTFN, check_warnings, run_unittest, make_bad_fd
+from test.test_support import (TESTFN, check_warnings, run_unittest,
+                               make_bad_fd, is_jython)
 from test.test_support import py3k_bytes as bytes
 from test.script_helper import run_python
 
 from _io import FileIO as _FileIO
 
+"""
+XXX: ignoring ValueError on Jython for now as the ValueError/IOError thing is
+     too mixed up right now. Needs investigation especially in Jython3 -- we
+     should get this cleaned up if possible.
+"""
+
 class AutoFileTests(unittest.TestCase):
     # file tests for which a test file is automatically set up
 
@@ -140,11 +147,17 @@
             os.close(f.fileno())
             try:
                 func(self, f)
+            except ValueError:
+                if not is_jython:
+                    self.fail("ValueError only on Jython")
             finally:
                 try:
                     self.f.close()
                 except IOError:
                     pass
+                except ValueError:
+                    if not is_jython:
+                        self.fail("ValueError only on Jython")
         return wrapper
 
     def ClosedFDRaises(func):
@@ -157,6 +170,9 @@
                 func(self, f)
             except IOError as e:
                 self.assertEqual(e.errno, errno.EBADF)
+            except ValueError as e:
+                if not is_jython:
+                    self.fail("ValueError only on Jython")
             else:
                 self.fail("Should have raised IOError")
             finally:
@@ -164,6 +180,10 @@
                     self.f.close()
                 except IOError:
                     pass
+                except ValueError:
+                    if not is_jython:
+                        self.fail("ValueError only on Jython")
+
         return wrapper
 
     @ClosedFDRaises

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


More information about the Jython-checkins mailing list