summaryrefslogtreecommitdiffstats
path: root/Modules/_sre.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_sre.c')
-rw-r--r--Modules/_sre.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/Modules/_sre.c b/Modules/_sre.c
index caf47aa..1776a16 100644
--- a/Modules/_sre.c
+++ b/Modules/_sre.c
@@ -2616,6 +2616,7 @@ init_sre(void)
{
PyObject* m;
PyObject* d;
+ PyObject* x;
/* Patch object types */
Pattern_Type.ob_type = Match_Type.ob_type =
@@ -2625,12 +2626,14 @@ init_sre(void)
d = PyModule_GetDict(m);
PyDict_SetItemString(
- d, "MAGIC", (PyObject*) PyInt_FromLong(SRE_MAGIC)
+ d, "MAGIC", (x = (PyObject*) PyInt_FromLong(SRE_MAGIC))
);
+ Py_XDECREF(x);
PyDict_SetItemString(
- d, "copyright", (PyObject*) PyString_FromString(copyright)
+ d, "copyright", (x = (PyObject*)PyString_FromString(copyright))
);
+ Py_XDECREF(x);
}