diff options
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/exceptions.c | 6 | ||||
-rw-r--r-- | Objects/stringlib/string_format.h | 2 | ||||
-rw-r--r-- | Objects/stringlib/unicodedefs.h | 2 | ||||
-rw-r--r-- | Objects/typeobject.c | 2 | ||||
-rw-r--r-- | Objects/unicodeobject.c | 12 |
5 files changed, 12 insertions, 12 deletions
diff --git a/Objects/exceptions.c b/Objects/exceptions.c index 6ef765b..e26c350 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -89,9 +89,9 @@ BaseException_str(PyBaseExceptionObject *self) case 0: return PyUnicode_FromString(""); case 1: - return PyObject_Unicode(PyTuple_GET_ITEM(self->args, 0)); + return PyObject_Str(PyTuple_GET_ITEM(self->args, 0)); default: - return PyObject_Unicode(self->args); + return PyObject_Str(self->args); } } @@ -939,7 +939,7 @@ SyntaxError_str(PySyntaxErrorObject *self) have_lineno = (self->lineno != NULL) && PyInt_CheckExact(self->lineno); if (!filename && !have_lineno) - return PyObject_Unicode(self->msg ? self->msg : Py_None); + return PyObject_Str(self->msg ? self->msg : Py_None); if (filename && have_lineno) return PyUnicode_FromFormat("%S (%s, line %ld)", diff --git a/Objects/stringlib/string_format.h b/Objects/stringlib/string_format.h index 6c3c1e6..b771149 100644 --- a/Objects/stringlib/string_format.h +++ b/Objects/stringlib/string_format.h @@ -770,7 +770,7 @@ do_conversion(PyObject *obj, STRINGLIB_CHAR conversion) case 'r': return PyObject_Repr(obj); case 's': - return PyObject_Unicode(obj); + return PyObject_Str(obj); default: PyErr_Format(PyExc_ValueError, "Unknown converion specifier %c", diff --git a/Objects/stringlib/unicodedefs.h b/Objects/stringlib/unicodedefs.h index fa6140f..64777be 100644 --- a/Objects/stringlib/unicodedefs.h +++ b/Objects/stringlib/unicodedefs.h @@ -20,7 +20,7 @@ #define STRINGLIB_NEW PyUnicode_FromUnicode #define STRINGLIB_RESIZE PyUnicode_Resize #define STRINGLIB_CHECK PyUnicode_Check -#define STRINGLIB_TOSTR PyObject_Unicode +#define STRINGLIB_TOSTR PyObject_Str #define STRINGLIB_WANT_CONTAINS_OBJ 1 diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 4266a7c..fd6f5ce 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -2954,7 +2954,7 @@ object_format(PyObject *self, PyObject *args) return NULL; } - self_as_str = PyObject_Unicode(self); + self_as_str = PyObject_Str(self); if (self_as_str != NULL) { /* find the format function */ format_meth = PyObject_GetAttrString(self_as_str, "__format__"); diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index ae34c9e..a011a9a 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -572,14 +572,14 @@ PyUnicode_FromFormatV(const char *format, va_list vargs) #endif #endif /* step 1: count the number of %S/%R format specifications - * (we call PyObject_Unicode()/PyObject_Repr() for these objects + * (we call PyObject_Str()/PyObject_Repr() for these objects * once during step 3 and put the result in an array) */ for (f = format; *f; f++) { if (*f == '%' && (*(f+1)=='S' || *(f+1)=='R')) ++callcount; } /* step 2: allocate memory for the results of - * PyObject_Unicode()/PyObject_Repr() calls */ + * PyObject_Str()/PyObject_Repr() calls */ if (callcount) { callresults = PyMem_Malloc(sizeof(PyObject *)*callcount); if (!callresults) { @@ -683,7 +683,7 @@ PyUnicode_FromFormatV(const char *format, va_list vargs) PyObject *obj = va_arg(count, PyObject *); PyObject *str; assert(obj); - str = PyObject_Unicode(obj); + str = PyObject_Str(obj); if (!str) goto fail; n += PyUnicode_GET_SIZE(str); @@ -987,7 +987,7 @@ PyObject *PyUnicode_FromOrdinal(int ordinal) PyObject *PyUnicode_FromObject(register PyObject *obj) { /* XXX Perhaps we should make this API an alias of - PyObject_Unicode() instead ?! */ + PyObject_Str() instead ?! */ if (PyUnicode_CheckExact(obj)) { Py_INCREF(obj); return obj; @@ -8671,7 +8671,7 @@ PyObject *PyUnicode_Format(PyObject *format, else { PyObject *unicode; if (c == 's') - temp = PyObject_Unicode(v); + temp = PyObject_Str(v); else temp = PyObject_Repr(v); if (temp == NULL) @@ -8889,7 +8889,7 @@ unicode_new(PyTypeObject *type, PyObject *args, PyObject *kwds) if (x == NULL) return (PyObject *)_PyUnicode_New(0); if (encoding == NULL && errors == NULL) - return PyObject_Unicode(x); + return PyObject_Str(x); else return PyUnicode_FromEncodedObject(x, encoding, errors); } |