From: Finn B. <bc...@us...> - 2001-11-06 16:48:40
|
Update of /cvsroot/jython/jython/org/python/core In directory usw-pr-cvs1:/tmp/cvs-serv22063 Modified Files: PyInstance.java Log Message: Fix for "[ #476580 ] 'del obj.non_member' : wrong exception" Catch KeyError from __delitem__ and raise a AttributeError instead. Index: PyInstance.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyInstance.java,v retrieving revision 2.26 retrieving revision 2.27 diff -C2 -d -r2.26 -r2.27 *** PyInstance.java 2001/10/30 19:09:23 2.26 --- PyInstance.java 2001/11/06 16:48:37 2.27 *************** *** 324,328 **** deller.__call__(this, new PyString(name)); } else { ! __dict__.__delitem__(name); } } --- 324,334 ---- deller.__call__(this, new PyString(name)); } else { ! try { ! __dict__.__delitem__(name); ! } catch (PyException exc) { ! if (Py.matchException(exc, Py.KeyError)) ! throw Py.AttributeError("class " + __class__.__name__ + ! " has no attribute '" + name + "'"); ! }; } } |