From 864220c441704e3d61fa521c682a23874b41e4ba Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Tue, 22 Sep 2009 21:53:21 +0300 Subject: Put some consistency to python object creation - all type object creation goes through foo_Wrap() which handle OOM and all type specific initialization --- python/rpmmi-py.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'python/rpmmi-py.c') diff --git a/python/rpmmi-py.c b/python/rpmmi-py.c index c1768d612..755a02960 100644 --- a/python/rpmmi-py.c +++ b/python/rpmmi-py.c @@ -214,11 +214,8 @@ PyTypeObject rpmmi_Type = { PyObject * rpmmi_Wrap(rpmdbMatchIterator mi, PyObject *s) { rpmmiObject * mio = PyObject_New(rpmmiObject, &rpmmi_Type); + if (mio == NULL) return PyErr_NoMemory(); - if (mio == NULL) { - PyErr_SetString(pyrpmError, "out of memory creating rpmmiObject"); - return NULL; - } mio->mi = mi; mio->ref = s; Py_INCREF(mio->ref); -- cgit v1.2.3