From: <pj...@us...> - 2009-03-30 17:12:52
|
Revision: 6124 http://jython.svn.sourceforge.net/jython/?rev=6124&view=rev Author: pjenvey Date: 2009-03-30 17:12:32 +0000 (Mon, 30 Mar 2009) Log Message: ----------- revert r2556, so == doesn't swallow AttributeErrors thanks Michele Cella fixes #1209 Modified Paths: -------------- trunk/jython/Lib/test/test_descr_jy.py trunk/jython/src/org/python/core/PyObject.java Modified: trunk/jython/Lib/test/test_descr_jy.py =================================================================== --- trunk/jython/Lib/test/test_descr_jy.py 2009-03-30 16:26:41 UTC (rev 6123) +++ trunk/jython/Lib/test/test_descr_jy.py 2009-03-30 17:12:32 UTC (rev 6124) @@ -331,6 +331,13 @@ self.assertRaises(AttributeError, func, old) self.assertRaises(TypeError, func, new) + def test_eq(self): + class A(object): + def __eq__(self, other): + return self.value == other.value + self.assertRaises(AttributeError, lambda: A() == A()) + + class GetAttrTestCase(unittest.TestCase): def test_raising_custom_attribute_error(self): # Very similar to Modified: trunk/jython/src/org/python/core/PyObject.java =================================================================== --- trunk/jython/src/org/python/core/PyObject.java 2009-03-30 16:26:41 UTC (rev 6123) +++ trunk/jython/src/org/python/core/PyObject.java 2009-03-30 17:12:32 UTC (rev 6124) @@ -1410,11 +1410,6 @@ if (res != null) return res; return _cmpeq_unsafe(o) == 0 ? Py.True : Py.False; - } catch (PyException e) { - if (Py.matchException(e, Py.AttributeError)) { - return Py.False; - } - throw e; } finally { delete_token(ts, token); ts.compareStateNesting--; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |