diff options
author | jbj <devnull@localhost> | 2004-01-16 05:47:51 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2004-01-16 05:47:51 +0000 |
commit | 46c795f21171aaa5cb606a82020bbc00009ca0c4 (patch) | |
tree | 46bfe6ef9f69ba6179521ad650f5a3e563c68011 | |
parent | ac38a8072fbaad04e97cc9745a597bca58bd97c5 (diff) | |
download | rpm-46c795f21171aaa5cb606a82020bbc00009ca0c4.tar.gz rpm-46c795f21171aaa5cb606a82020bbc00009ca0c4.tar.bz2 rpm-46c795f21171aaa5cb606a82020bbc00009ca0c4.zip |
Quick fix for [] vs None retrun.
CVS patchset: 7080
CVS date: 2004/01/16 05:47:51
-rw-r--r-- | python/header-py.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/python/header-py.c b/python/header-py.c index a04121f07..ea686f2db 100644 --- a/python/header-py.c +++ b/python/header-py.c @@ -499,8 +499,22 @@ static PyObject * hdr_subscript(hdrObject * s, PyObject * item) return NULL; } - if (!rpmHeaderGetEntry(s->h, tag, &type, &data, &count)) - return PyList_New(0); + if (!rpmHeaderGetEntry(s->h, tag, &type, &data, &count)) { + switch (tag) { + case RPMTAG_EPOCH: + case RPMTAG_NAME: + case RPMTAG_VERSION: + case RPMTAG_RELEASE: + case RPMTAG_ARCH: + case RPMTAG_OS: + Py_INCREF(Py_None); + return Py_None; + break; + default: + return PyList_New(0); + break; + } + } } switch (tag) { |