From 53cbdaa84c9e3c5f8b7ff2446452ff4d6f536219 Mon Sep 17 00:00:00 2001 From: Neal Norwitz Date: Thu, 23 Aug 2007 21:42:55 +0000 Subject: [PATCH] Convert a bunch of constant strings in C to unicode. --- Modules/_curses_panel.c | 2 +- Modules/bz2module.c | 2 +- Modules/gcmodule.c | 2 +- Modules/zlibmodule.c | 2 +- Objects/dictobject.c | 2 +- Objects/listobject.c | 4 ++-- Objects/setobject.c | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Modules/_curses_panel.c b/Modules/_curses_panel.c index 5eb4cf8ff7e..e73d9865bd2 100644 --- a/Modules/_curses_panel.c +++ b/Modules/_curses_panel.c @@ -472,7 +472,7 @@ init_curses_panel(void) PyDict_SetItemString(d, "error", PyCursesError); /* Make the version available */ - v = PyString_FromString(PyCursesVersion); + v = PyUnicode_FromString(PyCursesVersion); PyDict_SetItemString(d, "version", v); PyDict_SetItemString(d, "__version__", v); Py_DECREF(v); diff --git a/Modules/bz2module.c b/Modules/bz2module.c index c913c3fece1..65e3ae753ed 100644 --- a/Modules/bz2module.c +++ b/Modules/bz2module.c @@ -2048,7 +2048,7 @@ initbz2(void) if (m == NULL) return; - PyModule_AddObject(m, "__author__", PyString_FromString(__author__)); + PyModule_AddObject(m, "__author__", PyUnicode_FromString(__author__)); Py_INCREF(&BZ2File_Type); PyModule_AddObject(m, "BZ2File", (PyObject *)&BZ2File_Type); diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index 59607302f4d..63fb1f1eac0 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -851,7 +851,7 @@ collect(int generation) if (PyErr_Occurred()) { if (gc_str == NULL) - gc_str = PyString_FromString("garbage collection"); + gc_str = PyUnicode_FromString("garbage collection"); PyErr_WriteUnraisable(gc_str); Py_FatalError("unexpected exception during garbage collection"); } diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c index badc090d917..fd6c0b790c9 100644 --- a/Modules/zlibmodule.c +++ b/Modules/zlibmodule.c @@ -1039,7 +1039,7 @@ PyInit_zlib(void) PyModule_AddIntConstant(m, "Z_SYNC_FLUSH", Z_SYNC_FLUSH); PyModule_AddIntConstant(m, "Z_FULL_FLUSH", Z_FULL_FLUSH); - ver = PyString_FromString(ZLIB_VERSION); + ver = PyUnicode_FromString(ZLIB_VERSION); if (ver != NULL) PyModule_AddObject(m, "ZLIB_VERSION", ver); diff --git a/Objects/dictobject.c b/Objects/dictobject.c index 1ae38d5e495..a483b6cb4d8 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -194,7 +194,7 @@ PyDict_New(void) { register dictobject *mp; if (dummy == NULL) { /* Auto-initialize dummy */ - dummy = PyString_FromString(""); + dummy = PyUnicode_FromString(""); if (dummy == NULL) return NULL; #ifdef SHOW_CONVERSION_COUNTS diff --git a/Objects/listobject.c b/Objects/listobject.c index 7e2483e7fd6..50d9d9b76d2 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -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; diff --git a/Objects/setobject.c b/Objects/setobject.c index 2cc1743167b..7ff27b1f704 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -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 = PyUnicode_FromString(""); if (dummy == NULL) return NULL; }