Fix refcount bug in make_Zreplacement().

This commit is contained in:
Guido van Rossum 2007-08-10 19:26:04 +00:00
parent e6b59c5550
commit e9fb515d46

View file

@ -1159,6 +1159,7 @@ make_Zreplacement(PyObject *object, PyObject *tzinfoarg)
Zreplacement, NULL); Zreplacement, NULL);
if (Zreplacement == NULL) if (Zreplacement == NULL)
return NULL; return NULL;
Py_INCREF(Zreplacement);
} }
if (!PyString_Check(Zreplacement)) { if (!PyString_Check(Zreplacement)) {
PyErr_SetString(PyExc_TypeError, PyErr_SetString(PyExc_TypeError,