Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d76bb4e

Browse files
committed
Apply suggestions from code review
1 parent a6b0292 commit d76bb4e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Objects/structseq.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ structseq_replace(PyStructSequence *self, PyObject *args, PyObject *kwargs)
395395

396396
result = (PyStructSequence *) PyStructSequence_New(Py_TYPE(self));
397397
if (!result) {
398-
goto error;
398+
return NULL;
399399
}
400400

401401
if (kwargs != NULL) {
@@ -406,7 +406,7 @@ structseq_replace(PyStructSequence *self, PyObject *args, PyObject *kwargs)
406406
if (!key) {
407407
goto error;
408408
}
409-
PyObject *ob = _PyDict_Pop(kwargs, key, self->ob_item[i]); // borrowed
409+
PyObject *ob = _PyDict_Pop(kwargs, key, self->ob_item[i]);
410410
Py_DECREF(key);
411411
if (!ob) {
412412
goto error;
@@ -434,7 +434,7 @@ structseq_replace(PyStructSequence *self, PyObject *args, PyObject *kwargs)
434434
return (PyObject *)result;
435435

436436
error:
437-
Py_XDECREF(result);
437+
Py_DECREF(result);
438438
return NULL;
439439
}
440440

0 commit comments

Comments
 (0)