summaryrefslogtreecommitdiff
path: root/Modules/zipimport.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-12-24 10:35:59 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2015-12-24 10:35:59 +0200
commit585a1eed45faea53f836b1db2ac211d7f14b44c8 (patch)
tree3c5cfaf65c0c2b6a2daa08f73e73ae78b15bffa0 /Modules/zipimport.c
parent6044fdd1b841003aeef3852ddc1fa922eaab5dbd (diff)
downloadcpython-585a1eed45faea53f836b1db2ac211d7f14b44c8.tar.gz
Issue #20440: Massive replacing unsafe attribute setting code with special
macro Py_SETREF.
Diffstat (limited to 'Modules/zipimport.c')
-rw-r--r--Modules/zipimport.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Modules/zipimport.c b/Modules/zipimport.c
index 06abb312b3..7220faf08d 100644
--- a/Modules/zipimport.c
+++ b/Modules/zipimport.c
@@ -155,8 +155,7 @@ zipimporter_init(ZipImporter *self, PyObject *args, PyObject *kwds)
tmp = PyUnicode_FromFormat("%U%c", self->prefix, SEP);
if (tmp == NULL)
goto error;
- Py_DECREF(self->prefix);
- self->prefix = tmp;
+ Py_SETREF(self->prefix, tmp);
}
}
else