[Python-checkins] python/dist/src/Objects unicodeobject.c,2.149,2.150
M.-A. Lemburg
mal@lemburg.com
2002年5月29日 15:47:47 +0200
Neal Norwitz wrote:
> lemburg@users.sourceforge.net wrote:
>>>>Index: unicodeobject.c
>>===================================================================
>> substr = PyUnicode_FromObject(substr);
>> if (substr == NULL) {
>> Py_DECREF(substr);
>>! return -2;
>> }
>>> Can this code be correct? If substr is NULL, then it will be DECREF'd?
> It would seem the original substr should perhaps be DECREF'd.
> It seems like there needs to be another local variable.
> Also looking at the handling of str wrt DECREF'ing, this is different
> than substr, is that correct?
Good catch. That should be Py_DECREF(str);
--
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
______________________________________________________________________
Company & Consulting: http://www.egenix.com/
Python Software: http://www.egenix.com/files/python/
Meet us at EuroPython 2002: http://www.europython.org/