diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2009-09-22 21:53:21 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2009-09-22 21:53:21 +0300 |
commit | 864220c441704e3d61fa521c682a23874b41e4ba (patch) | |
tree | 074a4145961da5eae5857e5b6e1cc1b171cce463 /python/rpmmi-py.c | |
parent | ed557bbcf065905beebb42d50048cecf04c3e441 (diff) | |
download | librpm-tizen-864220c441704e3d61fa521c682a23874b41e4ba.tar.gz librpm-tizen-864220c441704e3d61fa521c682a23874b41e4ba.tar.bz2 librpm-tizen-864220c441704e3d61fa521c682a23874b41e4ba.zip |
Put some consistency to python object creation
- all type object creation goes through foo_Wrap() which handle OOM
and all type specific initialization
Diffstat (limited to 'python/rpmmi-py.c')
-rw-r--r-- | python/rpmmi-py.c | 5 |
1 files changed, 1 insertions, 4 deletions
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); |