[Python-checkins] CVS: python/dist/src/Objects floatobject.c,2.97,2.98
Tim Peters
tim_one@users.sourceforge.net
Tue, 11 Sep 2001 14:53:37 -0700
Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv19643/python/Objects
Modified Files:
floatobject.c
Log Message:
More bug 460020: when F is a subclass of float, disable the unary plus
optimization (+F(whatever)).
Index: floatobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/floatobject.c,v
retrieving revision 2.97
retrieving revision 2.98
diff -C2 -d -r2.97 -r2.98
*** floatobject.c 2001/09/11 16:13:52 2.97
--- floatobject.c 2001/09/11 21:53:35 2.98
***************
*** 554,559 ****
float_pos(PyFloatObject *v)
{
! Py_INCREF(v);
! return (PyObject *)v;
}
--- 554,563 ----
float_pos(PyFloatObject *v)
{
! if (PyFloat_CheckExact(v)) {
! Py_INCREF(v);
! return (PyObject *)v;
! }
! else
! return PyFloat_FromDouble(v->ob_fval);
}