summaryrefslogtreecommitdiffstats
path: root/Python/marshal.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/marshal.c')
-rw-r--r--Python/marshal.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/Python/marshal.c b/Python/marshal.c
index 86cf57d..5f392d9 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -1217,8 +1217,7 @@ r_object(RFILE *p)
if (!PyErr_Occurred())
PyErr_SetString(PyExc_TypeError,
"NULL object in marshal data for tuple");
- Py_DECREF(v);
- v = NULL;
+ Py_SETREF(v, NULL);
break;
}
PyTuple_SET_ITEM(v, i, v2);
@@ -1244,8 +1243,7 @@ r_object(RFILE *p)
if (!PyErr_Occurred())
PyErr_SetString(PyExc_TypeError,
"NULL object in marshal data for list");
- Py_DECREF(v);
- v = NULL;
+ Py_SETREF(v, NULL);
break;
}
PyList_SET_ITEM(v, i, v2);
@@ -1277,8 +1275,7 @@ r_object(RFILE *p)
Py_DECREF(val);
}
if (PyErr_Occurred()) {
- Py_DECREF(v);
- v = NULL;
+ Py_SETREF(v, NULL);
}
retval = v;
break;
@@ -1322,8 +1319,7 @@ r_object(RFILE *p)
if (!PyErr_Occurred())
PyErr_SetString(PyExc_TypeError,
"NULL object in marshal data for set");
- Py_DECREF(v);
- v = NULL;
+ Py_SETREF(v, NULL);
break;
}
if (PySet_Add(v, v2) == -1) {