summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2007-11-15 20:48:54 (GMT)
committerThomas Heller <theller@ctypes.org>2007-11-15 20:48:54 (GMT)
commit519a042c7c248e3ae23cf2a3c1152f91a5bd2791 (patch)
tree3eaef917fda4776da67d0426754f810e59d9f183 /Modules
parent6e8ea0fd9c46978cf3101bd3ea94022751464ad9 (diff)
downloadcpython-519a042c7c248e3ae23cf2a3c1152f91a5bd2791.zip
cpython-519a042c7c248e3ae23cf2a3c1152f91a5bd2791.tar.gz
cpython-519a042c7c248e3ae23cf2a3c1152f91a5bd2791.tar.bz2
Replace PyObject_Unicode with PyObject_Str everywhere, and remove the
#define for PyObject_Unicode in object.h.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_csv.c2
-rw-r--r--Modules/_ctypes/callproc.c2
-rw-r--r--Modules/_testcapimodule.c4
-rw-r--r--Modules/cjkcodecs/multibytecodec.c4
-rw-r--r--Modules/datetimemodule.c4
-rw-r--r--Modules/grpmodule.c2
6 files changed, 9 insertions, 9 deletions
diff --git a/Modules/_csv.c b/Modules/_csv.c
index 2ebbf38..10cf96f 100644
--- a/Modules/_csv.c
+++ b/Modules/_csv.c
@@ -1185,7 +1185,7 @@ csv_writerow(WriterObj *self, PyObject *seq)
else {
PyObject *str;
- str = PyObject_Unicode(field);
+ str = PyObject_Str(field);
Py_DECREF(field);
if (str == NULL)
return NULL;
diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
index 69129f7..1ab1d27 100644
--- a/Modules/_ctypes/callproc.c
+++ b/Modules/_ctypes/callproc.c
@@ -785,7 +785,7 @@ void Extend_Error_Info(PyObject *exc_class, char *fmt, ...)
goto error;
} else
PyErr_Clear();
- msg_str = PyObject_Unicode(v);
+ msg_str = PyObject_Str(v);
if (msg_str)
PyUnicode_AppendAndDel(&s, msg_str);
else {
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index cb33e85..9b67b5e 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -615,12 +615,12 @@ test_long_numbits(PyObject *self)
return Py_None;
}
-/* Example passing NULLs to PyObject_Str(NULL) and PyObject_Unicode(NULL). */
+/* Example passing NULLs to PyObject_Str(NULL). */
static PyObject *
test_null_strings(PyObject *self)
{
- PyObject *o1 = PyObject_Str(NULL), *o2 = PyObject_Unicode(NULL);
+ PyObject *o1 = PyObject_Str(NULL), *o2 = PyObject_Str(NULL);
PyObject *tuple = PyTuple_Pack(2, o1, o2);
Py_XDECREF(o1);
Py_XDECREF(o2);
diff --git a/Modules/cjkcodecs/multibytecodec.c b/Modules/cjkcodecs/multibytecodec.c
index 701b112..3e4e22d 100644
--- a/Modules/cjkcodecs/multibytecodec.c
+++ b/Modules/cjkcodecs/multibytecodec.c
@@ -552,7 +552,7 @@ MultibyteCodec_Encode(MultibyteCodecObject *self,
if (PyUnicode_Check(arg))
ucvt = NULL;
else {
- arg = ucvt = PyObject_Unicode(arg);
+ arg = ucvt = PyObject_Str(arg);
if (arg == NULL)
return NULL;
else if (!PyUnicode_Check(arg)) {
@@ -728,7 +728,7 @@ encoder_encode_stateful(MultibyteStatefulEncoderContext *ctx,
if (PyUnicode_Check(unistr))
ucvt = NULL;
else {
- unistr = ucvt = PyObject_Unicode(unistr);
+ unistr = ucvt = PyObject_Str(unistr);
if (unistr == NULL)
return NULL;
else if (!PyUnicode_Check(unistr)) {
diff --git a/Modules/datetimemodule.c b/Modules/datetimemodule.c
index 9342b19..bacc9ef 100644
--- a/Modules/datetimemodule.c
+++ b/Modules/datetimemodule.c
@@ -2444,7 +2444,7 @@ date_format(PyDateTime_Date *self, PyObject *args)
/* if the format is zero length, return str(self) */
if (PyUnicode_GetSize(format) == 0)
- return PyObject_Unicode((PyObject *)self);
+ return PyObject_Str((PyObject *)self);
return PyObject_CallMethod((PyObject *)self, "strftime", "O", format);
}
@@ -3220,7 +3220,7 @@ time_format(PyDateTime_Time *self, PyObject *args)
/* if the format is zero length, return str(self) */
if (PyUnicode_GetSize(format) == 0)
- return PyObject_Unicode((PyObject *)self);
+ return PyObject_Str((PyObject *)self);
return PyObject_CallMethod((PyObject *)self, "strftime", "O", format);
}
diff --git a/Modules/grpmodule.c b/Modules/grpmodule.c
index 853f0f6..7e47925 100644
--- a/Modules/grpmodule.c
+++ b/Modules/grpmodule.c
@@ -110,7 +110,7 @@ grp_getgrnam(PyObject *self, PyObject *pyo_name)
char *name;
struct group *p;
- py_str_name = PyObject_Unicode(pyo_name);
+ py_str_name = PyObject_Str(pyo_name);
if (!py_str_name)
return NULL;
name = PyUnicode_AsString(py_str_name);