summaryrefslogtreecommitdiffstats
path: root/Objects/stringobject.c
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-09-11 01:41:59 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-09-11 01:41:59 (GMT)
commit5a49ade70e19a76aa252cd596accf79930765f31 (patch)
treeab54e1ff25892e49fbb483ba4e461f30763e1fc6 /Objects/stringobject.c
parent8ff70a9606aa2f51f8329fbf09dfbbbae6ab6c11 (diff)
downloadcpython-5a49ade70e19a76aa252cd596accf79930765f31.zip
cpython-5a49ade70e19a76aa252cd596accf79930765f31.tar.gz
cpython-5a49ade70e19a76aa252cd596accf79930765f31.tar.bz2
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.
Diffstat (limited to 'Objects/stringobject.c')
-rw-r--r--Objects/stringobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/stringobject.c b/Objects/stringobject.c
index 4c28500..9c873ec 100644
--- a/Objects/stringobject.c
+++ b/Objects/stringobject.c
@@ -2711,7 +2711,7 @@ str_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
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);