[Jython-checkins] jython: Revert exception change as it broke test_file. Change test_os instead.
frank.wierzbicki
jython-checkins at python.org
Fri Mar 16 07:27:09 CET 2012
http://hg.python.org/jython/rev/5acc158d346f
changeset: 6400:5acc158d346f
user: Frank Wierzbicki <fwierzbicki at gmail.com>
date: Thu Mar 15 23:27:03 2012 -0700
summary:
Revert exception change as it broke test_file. Change test_os instead.
files:
Lib/test/test_os.py | 2 ++
src/org/python/core/io/IOBase.java | 4 ++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -581,6 +581,8 @@
f(test_support.make_bad_fd(), *args)
except OSError as e:
self.assertEqual(e.errno, errno.EBADF)
+ except ValueError:
+ self.assertTrue(test_support.is_jython)
else:
self.fail("%r didn't raise a OSError with a bad file descriptor"
% f)
diff --git a/src/org/python/core/io/IOBase.java b/src/org/python/core/io/IOBase.java
--- a/src/org/python/core/io/IOBase.java
+++ b/src/org/python/core/io/IOBase.java
@@ -185,12 +185,12 @@
}
/**
- * Raise an OSError if the file is closed.
+ * Raise a ValueError if the file is closed.
*
*/
public void checkClosed() {
if (closed()) {
- throw Py.OSError(Errno.EBADF);
+ throw Py.ValueError("I/O operation on closed file");
}
}
--
Repository URL: http://hg.python.org/jython
More information about the Jython-checkins
mailing list