Fixes for issue 1752184, ensuring type objects are always created

with a PyUnicode name.
This commit is contained in:
Guido van Rossum 2007-11-02 23:07:07 +00:00
parent 15c974651f
commit e845c0f922
4 changed files with 15 additions and 6 deletions

View file

@ -410,7 +410,7 @@ static PyTypeObject* make_type(char *type, PyTypeObject* base, char**fields, int
}
PyTuple_SET_ITEM(fnames, i, field);
}
result = PyObject_CallFunction((PyObject*)&PyType_Type, "s(O){sOss}",
result = PyObject_CallFunction((PyObject*)&PyType_Type, "U(O){sOss}",
type, base, "_fields", fnames, "__module__", "_ast");
Py_DECREF(fnames);
return (PyTypeObject*)result;

View file

@ -608,7 +608,7 @@ PyErr_NewException(const char *name, PyObject *base, PyObject *dict)
goto failure;
}
/* Create a real new-style class. */
result = PyObject_CallFunction((PyObject *)&PyType_Type, "sOO",
result = PyObject_CallFunction((PyObject *)&PyType_Type, "UOO",
dot+1, bases, dict);
failure:
Py_XDECREF(bases);