diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-12-27 12:36:18 +0200 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-12-27 12:36:18 +0200 |
commit | 4a1e70fc31d224786a32f950edaf73c8ea9c194d (patch) | |
tree | 2000711f6cd68f009e4859ce3f9e1e9fe0a1f76e /Modules/_pickle.c | |
parent | a5892abf235c67cf8e75b7fcef65e6aebe701d4c (diff) | |
download | cpython-git-4a1e70fc31d224786a32f950edaf73c8ea9c194d.tar.gz |
Issue #20440: Applied yet one patch for using Py_SETREF.
The patch is automatically generated, it replaces the code that uses Py_CLEAR.
Diffstat (limited to 'Modules/_pickle.c')
-rw-r--r-- | Modules/_pickle.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Modules/_pickle.c b/Modules/_pickle.c index 56bbd587b5..2a070e22e7 100644 --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -846,9 +846,8 @@ PyMemoTable_Set(PyMemoTable *self, PyObject *key, Py_ssize_t value) static int _Pickler_ClearBuffer(PicklerObject *self) { - Py_CLEAR(self->output_buffer); - self->output_buffer = - PyBytes_FromStringAndSize(NULL, self->max_output_len); + Py_SETREF(self->output_buffer, + PyBytes_FromStringAndSize(NULL, self->max_output_len)); if (self->output_buffer == NULL) return -1; self->output_len = 0; @@ -3089,9 +3088,8 @@ fix_imports(PyObject **module_name, PyObject **global_name) Py_TYPE(item)->tp_name); return -1; } - Py_CLEAR(*module_name); Py_INCREF(item); - *module_name = item; + Py_SETREF(*module_name, item); } else if (PyErr_Occurred()) { return -1; |