diff options
author | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2011-11-06 14:10:48 (GMT) |
---|---|---|
committer | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2011-11-06 14:10:48 (GMT) |
commit | 864741b2c7aaabda736f917694a1d3b26700e8e3 (patch) | |
tree | 8a79396976bd3f512eec73f88abfb60ca787377e /Doc/includes/noddy4.c | |
parent | 08ad2fbc7f7abb687327b22eb7f65ac388742ab9 (diff) | |
download | cpython-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/noddy4.c')
-rw-r--r-- | Doc/includes/noddy4.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/Doc/includes/noddy4.c b/Doc/includes/noddy4.c index c747682..eb9622a 100644 --- a/Doc/includes/noddy4.c +++ b/Doc/includes/noddy4.c @@ -118,15 +118,6 @@ static PyMemberDef Noddy_members[] = { 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; - } - if (self->first == NULL) { PyErr_SetString(PyExc_AttributeError, "first"); return NULL; @@ -137,14 +128,7 @@ Noddy_name(Noddy* self) 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[] = { |