Mercurial > cpython-lru_cache-weakref
diff Objects/stringobject.c @ 19846:662e22f99639 legacy-trunk
More on SF bug [#460020] bug or feature: unicode() and subclasses.
Repaired str(i) to return a genuine string when i is an instance of a str
subclass. New PyString_CheckExact() macro.
| author | Tim Peters <tim.peters@gmail.com> |
|---|---|
| date | Tue, 11 Sep 2001 01:41:59 +0000 |
| parents | 20fb7591f885 |
| children | df66b4dd0b0d |
line wrap: on
line diff
--- a/Objects/stringobject.c Mon Sep 10 23:53:53 2001 +0000 +++ b/Objects/stringobject.c Tue Sep 11 01:41:59 2001 +0000 @@ -2711,7 +2711,7 @@ tmp = string_new(&PyString_Type, args, kwds); if (tmp == NULL) return NULL; - assert(PyString_Check(tmp)); + assert(PyString_CheckExact(tmp)); new = type->tp_alloc(type, n = PyString_GET_SIZE(tmp)); if (new != NULL) memcpy(PyString_AS_STRING(new), PyString_AS_STRING(tmp), n+1);
