[Python-checkins] python/dist/src/Objects abstract.c,2.106,2.107
nascheme@projects.sourceforge.net
nascheme@projects.sourceforge.net
Mon, 18 Nov 2002 08:04:59 -0800
Update of /cvsroot/python/python/dist/src/Objects
In directory sc8-pr-cvs1:/tmp/cvs-serv20324/Objects
Modified Files:
abstract.c
Log Message:
str and unicode objects now have a __mod__ slot so don't special case them in
PyNumber_Remainder(). This fixes SF bug #615506 and allows string and unicode
subclasses to override __mod__.
Index: abstract.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/abstract.c,v
retrieving revision 2.106
retrieving revision 2.107
diff -C2 -d -r2.106 -r2.107
*** abstract.c 5 Nov 2002 18:05:49 -0000 2.106
--- abstract.c 18 Nov 2002 16:04:52 -0000 2.107
***************
*** 640,649 ****
PyNumber_Remainder(PyObject *v, PyObject *w)
{
- if (PyString_Check(v))
- return PyString_Format(v, w);
- #ifdef Py_USING_UNICODE
- else if (PyUnicode_Check(v))
- return PyUnicode_Format(v, w);
- #endif
return binary_op(v, w, NB_SLOT(nb_remainder), "%");
}
--- 640,643 ----