mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Convert a bunch of constant strings in C to unicode.
This commit is contained in:
parent
d6d2f2f939
commit
53cbdaa84c
7 changed files with 8 additions and 8 deletions
|
@ -194,7 +194,7 @@ PyDict_New(void)
|
|||
{
|
||||
register dictobject *mp;
|
||||
if (dummy == NULL) { /* Auto-initialize dummy */
|
||||
dummy = PyString_FromString("<dummy key>");
|
||||
dummy = PyUnicode_FromString("<dummy key>");
|
||||
if (dummy == NULL)
|
||||
return NULL;
|
||||
#ifdef SHOW_CONVERSION_COUNTS
|
||||
|
|
|
@ -142,7 +142,7 @@ PyList_GetItem(PyObject *op, Py_ssize_t i)
|
|||
}
|
||||
if (i < 0 || i >= Py_Size(op)) {
|
||||
if (indexerr == NULL)
|
||||
indexerr = PyString_FromString(
|
||||
indexerr = PyUnicode_FromString(
|
||||
"list index out of range");
|
||||
PyErr_SetObject(PyExc_IndexError, indexerr);
|
||||
return NULL;
|
||||
|
@ -362,7 +362,7 @@ list_item(PyListObject *a, Py_ssize_t i)
|
|||
{
|
||||
if (i < 0 || i >= Py_Size(a)) {
|
||||
if (indexerr == NULL)
|
||||
indexerr = PyString_FromString(
|
||||
indexerr = PyUnicode_FromString(
|
||||
"list index out of range");
|
||||
PyErr_SetObject(PyExc_IndexError, indexerr);
|
||||
return NULL;
|
||||
|
|
|
@ -966,7 +966,7 @@ make_new_set(PyTypeObject *type, PyObject *iterable)
|
|||
register PySetObject *so = NULL;
|
||||
|
||||
if (dummy == NULL) { /* Auto-initialize dummy */
|
||||
dummy = PyString_FromString("<dummy key>");
|
||||
dummy = PyUnicode_FromString("<dummy key>");
|
||||
if (dummy == NULL)
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue