summaryrefslogtreecommitdiff
path: root/python/rpmds-py.c
diff options
context:
space:
mode:
Diffstat (limited to 'python/rpmds-py.c')
-rw-r--r--python/rpmds-py.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/python/rpmds-py.c b/python/rpmds-py.c
index 9eae9a228..86d993f5b 100644
--- a/python/rpmds-py.c
+++ b/python/rpmds-py.c
@@ -31,19 +31,19 @@ rpmds_Ix(rpmdsObject * s)
static PyObject *
rpmds_DNEVR(rpmdsObject * s)
{
- return Py_BuildValue("s", rpmdsDNEVR(s->ds));
+ return utf8FromString(rpmdsDNEVR(s->ds));
}
static PyObject *
rpmds_N(rpmdsObject * s)
{
- return Py_BuildValue("s", rpmdsN(s->ds));
+ return utf8FromString(rpmdsN(s->ds));
}
static PyObject *
rpmds_EVR(rpmdsObject * s)
{
- return Py_BuildValue("s", rpmdsEVR(s->ds));
+ return utf8FromString(rpmdsEVR(s->ds));
}
static PyObject *
@@ -230,14 +230,14 @@ rpmds_subscript(rpmdsObject * s, PyObject * key)
{
int ix;
- if (!PyInt_Check(key)) {
+ if (!PyLong_Check(key)) {
PyErr_SetString(PyExc_TypeError, "integer expected");
return NULL;
}
- ix = (int) PyInt_AsLong(key);
+ ix = (int) PyLong_AsLong(key);
rpmdsSetIx(s->ds, ix);
- return Py_BuildValue("s", rpmdsDNEVR(s->ds));
+ return utf8FromString(rpmdsDNEVR(s->ds));
}
static PyMappingMethods rpmds_as_mapping = {
@@ -258,9 +258,9 @@ static int depflags(PyObject *o, rpmsenseFlags *senseFlags)
PyObject *str = NULL;
rpmsenseFlags flags = RPMSENSE_ANY;
- if (PyInt_Check(o)) {
+ if (PyLong_Check(o)) {
ok = 1;
- flags = PyInt_AsLong(o);
+ flags = PyLong_AsLong(o);
} else if (utf8FromPyObject(o, &str)) {
ok = 1;
for (const char *s = PyBytes_AsString(str); *s; s++) {
@@ -339,7 +339,7 @@ static char rpmds_doc[] =
PyTypeObject rpmds_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
- "rpm.ds", /* tp_name */
+ PYTHON_MODULENAME".ds", /* tp_name */
sizeof(rpmdsObject), /* tp_basicsize */
0, /* tp_itemsize */
/* methods */