summaryrefslogtreecommitdiffstats
path: root/Modules/_lzmamodule.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-12-27 10:36:18 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-12-27 10:36:18 (GMT)
commit4a1e70fc31d224786a32f950edaf73c8ea9c194d (patch)
tree2000711f6cd68f009e4859ce3f9e1e9fe0a1f76e /Modules/_lzmamodule.c
parenta5892abf235c67cf8e75b7fcef65e6aebe701d4c (diff)
downloadcpython-4a1e70fc31d224786a32f950edaf73c8ea9c194d.zip
cpython-4a1e70fc31d224786a32f950edaf73c8ea9c194d.tar.gz
cpython-4a1e70fc31d224786a32f950edaf73c8ea9c194d.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/_lzmamodule.c')
-rw-r--r--Modules/_lzmamodule.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Modules/_lzmamodule.c b/Modules/_lzmamodule.c
index 7e4e2df..9bc8033 100644
--- a/Modules/_lzmamodule.c
+++ b/Modules/_lzmamodule.c
@@ -1011,9 +1011,8 @@ decompress(Decompressor *d, uint8_t *data, size_t len, Py_ssize_t max_length)
if (d->eof) {
d->needs_input = 0;
if (lzs->avail_in > 0) {
- Py_CLEAR(d->unused_data);
- d->unused_data = PyBytes_FromStringAndSize(
- (char *)lzs->next_in, lzs->avail_in);
+ Py_SETREF(d->unused_data,
+ PyBytes_FromStringAndSize((char *)lzs->next_in, lzs->avail_in));
if (d->unused_data == NULL)
goto error;
}