summaryrefslogtreecommitdiffstats
path: root/Doc/includes/noddy3.c
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2011-11-06 14:10:48 (GMT)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2011-11-06 14:10:48 (GMT)
commit864741b2c7aaabda736f917694a1d3b26700e8e3 (patch)
tree8a79396976bd3f512eec73f88abfb60ca787377e /Doc/includes/noddy3.c
parent08ad2fbc7f7abb687327b22eb7f65ac388742ab9 (diff)
downloadcpython-864741b2c7aaabda736f917694a1d3b26700e8e3.zip
cpython-864741b2c7aaabda736f917694a1d3b26700e8e3.tar.gz
cpython-864741b2c7aaabda736f917694a1d3b26700e8e3.tar.bz2
Issue #13350: Replace most usages of PyUnicode_Format by PyUnicode_FromFormat.
Diffstat (limited to 'Doc/includes/noddy3.c')
-rw-r--r--Doc/includes/noddy3.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/Doc/includes/noddy3.c b/Doc/includes/noddy3.c
index 002a0e1..8a5a753 100644
--- a/Doc/includes/noddy3.c
+++ b/Doc/includes/noddy3.c
@@ -147,23 +147,7 @@ static PyGetSetDef Noddy_getseters[] = {
static PyObject *
Noddy_name(Noddy* self)
{
- static PyObject *format = NULL;
- PyObject *args, *result;
-
- if (format == NULL) {
- format = PyUnicode_FromString("%s %s");
- if (format == NULL)
- return NULL;
- }
-
- args = Py_BuildValue("OO", self->first, self->last);
- if (args == NULL)
- return NULL;
-
- result = PyUnicode_Format(format, args);
- Py_DECREF(args);
-
- return result;
+ return PyUnicode_FromFormat("%S %S", self->first, self->last);
}
static PyMethodDef Noddy_methods[] = {