diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-12-27 10:38:48 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-12-27 10:38:48 (GMT) |
commit | 8688acaf2ef4f355725bf4d5bf024fed99752061 (patch) | |
tree | 54fbd38241f36f98207830447e5f9c4f73627318 /Modules/_struct.c | |
parent | 82ea0f9517a1b799e7457fd6afa19b9c2d75da7f (diff) | |
download | cpython-8688acaf2ef4f355725bf4d5bf024fed99752061.zip cpython-8688acaf2ef4f355725bf4d5bf024fed99752061.tar.gz cpython-8688acaf2ef4f355725bf4d5bf024fed99752061.tar.bz2 |
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/_struct.c')
-rw-r--r-- | Modules/_struct.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Modules/_struct.c b/Modules/_struct.c index 02dd7d3..196a093 100644 --- a/Modules/_struct.c +++ b/Modules/_struct.c @@ -1377,15 +1377,13 @@ s_init(PyObject *self, PyObject *args, PyObject *kwds) if (PyString_Check(o_format)) { Py_INCREF(o_format); - Py_CLEAR(soself->s_format); - soself->s_format = o_format; + Py_SETREF(soself->s_format, o_format); } else if (PyUnicode_Check(o_format)) { PyObject *str = PyUnicode_AsEncodedString(o_format, "ascii", NULL); if (str == NULL) return -1; - Py_CLEAR(soself->s_format); - soself->s_format = str; + Py_SETREF(soself->s_format, str); } else { PyErr_Format(PyExc_TypeError, |