Commit 47fe5c0d authored by Eli Bendersky's avatar Eli Bendersky

Issue #12672: fix code samples in extending/newtypes.html for PEP-7 compliance

parent ff3d3e4c
...@@ -289,15 +289,13 @@ strings, so we provide a new method:: ...@@ -289,15 +289,13 @@ strings, so we provide a new method::
self = (Noddy *)type->tp_alloc(type, 0); self = (Noddy *)type->tp_alloc(type, 0);
if (self != NULL) { if (self != NULL) {
self->first = PyString_FromString(""); self->first = PyString_FromString("");
if (self->first == NULL) if (self->first == NULL) {
{
Py_DECREF(self); Py_DECREF(self);
return NULL; return NULL;
} }
self->last = PyString_FromString(""); self->last = PyString_FromString("");
if (self->last == NULL) if (self->last == NULL) {
{
Py_DECREF(self); Py_DECREF(self);
return NULL; return NULL;
} }
......
...@@ -24,15 +24,13 @@ Noddy_new(PyTypeObject *type, PyObject *args, PyObject *kwds) ...@@ -24,15 +24,13 @@ Noddy_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
self = (Noddy *)type->tp_alloc(type, 0); self = (Noddy *)type->tp_alloc(type, 0);
if (self != NULL) { if (self != NULL) {
self->first = PyUnicode_FromString(""); self->first = PyUnicode_FromString("");
if (self->first == NULL) if (self->first == NULL) {
{
Py_DECREF(self); Py_DECREF(self);
return NULL; return NULL;
} }
self->last = PyUnicode_FromString(""); self->last = PyUnicode_FromString("");
if (self->last == NULL) if (self->last == NULL) {
{
Py_DECREF(self); Py_DECREF(self);
return NULL; return NULL;
} }
......
...@@ -24,15 +24,13 @@ Noddy_new(PyTypeObject *type, PyObject *args, PyObject *kwds) ...@@ -24,15 +24,13 @@ Noddy_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
self = (Noddy *)type->tp_alloc(type, 0); self = (Noddy *)type->tp_alloc(type, 0);
if (self != NULL) { if (self != NULL) {
self->first = PyUnicode_FromString(""); self->first = PyUnicode_FromString("");
if (self->first == NULL) if (self->first == NULL) {
{
Py_DECREF(self); Py_DECREF(self);
return NULL; return NULL;
} }
self->last = PyUnicode_FromString(""); self->last = PyUnicode_FromString("");
if (self->last == NULL) if (self->last == NULL) {
{
Py_DECREF(self); Py_DECREF(self);
return NULL; return NULL;
} }
......
...@@ -58,15 +58,13 @@ Noddy_new(PyTypeObject *type, PyObject *args, PyObject *kwds) ...@@ -58,15 +58,13 @@ Noddy_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
self = (Noddy *)type->tp_alloc(type, 0); self = (Noddy *)type->tp_alloc(type, 0);
if (self != NULL) { if (self != NULL) {
self->first = PyUnicode_FromString(""); self->first = PyUnicode_FromString("");
if (self->first == NULL) if (self->first == NULL) {
{
Py_DECREF(self); Py_DECREF(self);
return NULL; return NULL;
} }
self->last = PyUnicode_FromString(""); self->last = PyUnicode_FromString("");
if (self->last == NULL) if (self->last == NULL) {
{
Py_DECREF(self); Py_DECREF(self);
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment