summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2009-09-28 18:22:14 +0300
committerPanu Matilainen <pmatilai@redhat.com>2009-09-28 18:22:14 +0300
commit600ccbe9d43e5857eb9b9925975f63d0e40286d8 (patch)
tree95efb533bf49d26233e9c0c7a5d349e66c15409d /python
parentac3f9f729b9a3b938d3344278c7e0564934f3871 (diff)
downloadrpm-600ccbe9d43e5857eb9b9925975f63d0e40286d8.tar.gz
rpm-600ccbe9d43e5857eb9b9925975f63d0e40286d8.tar.bz2
rpm-600ccbe9d43e5857eb9b9925975f63d0e40286d8.zip
Require expected type in PyArg_ParseTupleAndKeywords() already
Diffstat (limited to 'python')
-rw-r--r--python/rpmts-py.c27
1 files changed, 3 insertions, 24 deletions
diff --git a/python/rpmts-py.c b/python/rpmts-py.c
index 3cb138f03..59605e9f8 100644
--- a/python/rpmts-py.c
+++ b/python/rpmts-py.c
@@ -496,16 +496,9 @@ rpmts_HdrCheck(rpmtsObject * s, PyObject * args, PyObject * kwds)
rpmRC rpmrc;
char * kwlist[] = {"headers", NULL};
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "O:HdrCheck", kwlist, &blob))
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "S:HdrCheck", kwlist, &blob))
return NULL;
- if (blob == Py_None) {
- Py_RETURN_NONE;
- }
- if (!PyString_Check(blob)) {
- PyErr_SetString(pyrpmError, "hdrCheck takes a string of octets");
- return result;
- }
uh = PyString_AsString(blob);
uc = PyString_Size(blob);
@@ -581,16 +574,9 @@ rpmts_PgpPrtPkts(rpmtsObject * s, PyObject * args, PyObject * kwds)
int rc;
char * kwlist[] = {"octets", NULL};
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "O:PgpPrtPkts", kwlist, &blob))
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "S:PgpPrtPkts", kwlist, &blob))
return NULL;
- if (blob == Py_None) {
- Py_RETURN_NONE;
- }
- if (!PyString_Check(blob)) {
- PyErr_SetString(pyrpmError, "pgpPrtPkts takes a string of octets");
- return NULL;
- }
pkt = (unsigned char *)PyString_AsString(blob);
pktlen = PyString_Size(blob);
@@ -608,17 +594,10 @@ rpmts_PgpImportPubkey(rpmtsObject * s, PyObject * args, PyObject * kwds)
int rc;
char * kwlist[] = {"pubkey", NULL};
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "O:PgpImportPubkey",
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "S:PgpImportPubkey",
kwlist, &blob))
return NULL;
- if (blob == Py_None) {
- Py_RETURN_NONE;
- }
- if (!PyString_Check(blob)) {
- PyErr_SetString(pyrpmError, "PgpImportPubkey takes a string of octets");
- return NULL;
- }
pkt = (unsigned char *)PyString_AsString(blob);
pktlen = PyString_Size(blob);