When __slots__ are set to a unicode string, make it work the same as

setting a plain string, ie don't expand to single letter identifiers.
This commit is contained in:
Neal Norwitz 2007-04-14 05:25:50 +00:00
parent e6bdb9be0e
commit cbd9ee69ee
3 changed files with 21 additions and 2 deletions

View file

@ -1816,7 +1816,7 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
/* Have slots */
/* Make it into a tuple */
if (PyString_Check(slots))
if (PyString_Check(slots) || PyUnicode_Check(slots))
slots = PyTuple_Pack(1, slots);
else
slots = PySequence_Tuple(slots);