Update of /cvsroot/jython/jython/org/python/core
In directory usw-pr-cvs1:/tmp/cvs-serv9790
Modified Files:
__builtin__.java
Log Message:
Throw TypeError when abs() argument isn't a number. I wish I had a better
solution.
Index: __builtin__.java
===================================================================
RCS file: /cvsroot/jython/jython/org/python/core/__builtin__.java,v
retrieving revision 2.45
retrieving revision 2.46
diff -C2 -d -r2.45 -r2.46
*** __builtin__.java 26 May 2002 20:51:46 -0000 2.45
--- __builtin__.java 26 May 2002 20:53:45 -0000 2.46
***************
*** 137,141 ****
public static PyObject abs(PyObject o) {
! return o.__abs__();
}
--- 137,143 ----
public static PyObject abs(PyObject o) {
! if (o.isNumberType())
! return o.__abs__();
! throw Py.TypeError("bad operand type for abs()");
}
|