[Python-checkins] r51276 - in python/trunk: Doc/api/concrete.tex Doc/api/exceptions.tex Doc/lib/libexcs.tex Doc/lib/libwarnings.tex Include/pyerrors.h Include/unicodeobject.h Lib/test/exception_hierarchy.txt Misc/NEWS Objects/exceptions.c Objects/object.c Objects/unicodeobject.c

M.-A. Lemburg mal at egenix.com
Mon Aug 14 14:54:31 CEST 2006


Georg Brandl wrote:
> marc-andre.lemburg wrote:
> 
>> Modified: python/trunk/Objects/unicodeobject.c
>> ==============================================================================
>> --- python/trunk/Objects/unicodeobject.c	(original)
>> +++ python/trunk/Objects/unicodeobject.c	Mon Aug 14 12:55:19 2006
> 
>> @@ -6985,11 +7061,14 @@
>>      PyUnicode_Contains, 		/* sq_contains */
>>  };
>>  
>> +#define HASINDEX(o) PyType_HasFeature((o)->ob_type, Py_TPFLAGS_HAVE_INDEX)
>> +
>>  static PyObject*
>>  unicode_subscript(PyUnicodeObject* self, PyObject* item)
>>  {
>> -    if (PyIndex_Check(item)) {
>> -        Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError);
>> +    PyNumberMethods *nb = item->ob_type->tp_as_number;
>> +    if (nb != NULL && HASINDEX(item) && nb->nb_index != NULL) {
>> +        Py_ssize_t i = nb->nb_index(item);
>>          if (i == -1 && PyErr_Occurred())
>>              return NULL;
>>          if (i < 0)
> 
> This hunk must be reverted. The new code was introduced as part of the new
> __index__ handling in rev. 51236, and your patch reverted it, just like the
> NEWS entries. (This is causing all the buildbot failures)

Hmm, thanks. I'll correct this now.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Aug 14 2006)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::


More information about the Python-checkins mailing list