summaryrefslogtreecommitdiffstats
path: root/Python/structmember.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-10-19 21:48:41 (GMT)
committerGuido van Rossum <guido@python.org>2007-10-19 21:48:41 (GMT)
commit21431e85d505b9698c085c25cbf1b2997a352b85 (patch)
treefc98ab07e6d8f8f6e41a2fdb9a24b54d9de330b8 /Python/structmember.c
parent630e46424a578bb619037dceed72a734d39ee237 (diff)
downloadcpython-21431e85d505b9698c085c25cbf1b2997a352b85.zip
cpython-21431e85d505b9698c085c25cbf1b2997a352b85.tar.gz
cpython-21431e85d505b9698c085c25cbf1b2997a352b85.tar.bz2
This is the uncontroversial half of patch 1263 by Thomas Lee:
changes to codecs.c and structmember.c to use PyUnicode instead of PyString.
Diffstat (limited to 'Python/structmember.c')
-rw-r--r--Python/structmember.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/Python/structmember.c b/Python/structmember.c
index 3eb7218..c4b7d80 100644
--- a/Python/structmember.c
+++ b/Python/structmember.c
@@ -51,13 +51,13 @@ PyMember_GetOne(const char *addr, PyMemberDef *l)
v = Py_None;
}
else
- v = PyString_FromString(*(char**)addr);
+ v = PyUnicode_FromString(*(char**)addr);
break;
case T_STRING_INPLACE:
- v = PyString_FromString((char*)addr);
+ v = PyUnicode_FromString((char*)addr);
break;
case T_CHAR:
- v = PyString_FromStringAndSize((char*)addr, 1);
+ v = PyUnicode_FromStringAndSize((char*)addr, 1);
break;
case T_OBJECT:
v = *(PyObject **)addr;
@@ -225,8 +225,8 @@ PyMember_SetOne(char *addr, PyMemberDef *l, PyObject *v)
Py_XDECREF(oldv);
break;
case T_CHAR:
- if (PyString_Check(v) && PyString_Size(v) == 1) {
- *(char*)addr = PyString_AsString(v)[0];
+ if (PyUnicode_Check(v) && PyUnicode_GetSize(v) == 1) {
+ *(char*)addr = PyUnicode_AsString(v)[0];
}
else {
PyErr_BadArgument();