[Python-checkins] python/dist/src/Objects unicodeobject.c,2.176,2.177

Guido van Rossum guido@python.org
Wed, 08 Jan 2003 17:07:41 -0500


> Modified Files:
> 	unicodeobject.c 
> Log Message:
> Remove variable owned from PyUnicode_FromEncodedObject, which is unused
> (except for Py_DECREF calls) since the introduction of __unicode__.
> 
> 
> Index: unicodeobject.c
> ===================================================================
> RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v
> retrieving revision 2.176
> retrieving revision 2.177
> diff -C2 -d -r2.176 -r2.177
> *** unicodeobject.c	29 Dec 2002 19:44:06 -0000	2.176
> --- unicodeobject.c	8 Jan 2003 20:38:39 -0000	2.177
> ***************
> *** 453,457 ****
>       const char *s = NULL;
>       int len;
> -     int owned = 0;
>       PyObject *v;
>       
> --- 453,456 ----
> ***************
> *** 511,523 ****
>   	v = PyUnicode_Decode(s, len, encoding, errors);
>   
> -     if (owned) {
> - 	Py_DECREF(obj);
> -     }
>       return v;
>   
>    onError:
> -     if (owned) {
> - 	Py_DECREF(obj);
> -     }
>       return NULL;
>   }
> --- 510,516 ----

Are you sure that the real problem isn't that the assignment

  owned = 1;

somewhere got lost?

--Guido van Rossum (home page: http://www.python.org/~guido/)