summaryrefslogtreecommitdiff
path: root/python/apt_instmodule.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2010-04-01 18:26:37 +0200
committerJulian Andres Klode <jak@debian.org>2010-04-01 18:26:37 +0200
commitc3d6edddcdcd40ff7477430a20a3e3be7e188963 (patch)
tree71744f04bebd432c7ff54fa89b4f116550041d5d /python/apt_instmodule.cc
parentee15a84128199c2ef23afcf88dbc2f02df08adcc (diff)
downloadpython-apt-c3d6edddcdcd40ff7477430a20a3e3be7e188963.tar.gz
python: Return bool instead of int to Python where possible, looks better.
Diffstat (limited to 'python/apt_instmodule.cc')
-rw-r--r--python/apt_instmodule.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/python/apt_instmodule.cc b/python/apt_instmodule.cc
index 2721509e..b1038474 100644
--- a/python/apt_instmodule.cc
+++ b/python/apt_instmodule.cc
@@ -102,7 +102,7 @@ static PyObject *debExtractArchive(PyObject *Self,PyObject *Args)
if (_error->PendingError() == true) {
if (Rootdir != NULL)
chdir (cwd);
- return HandleErrors(Py_BuildValue("b",false));
+ return HandleErrors();
}
// extracts relative to the current dir
@@ -112,9 +112,9 @@ static PyObject *debExtractArchive(PyObject *Self,PyObject *Args)
if (Rootdir != NULL)
chdir (cwd);
if (res == false)
- return HandleErrors(Py_BuildValue("b",res));
+ return HandleErrors(PyBool_FromLong(res));
}
- return HandleErrors(Py_BuildValue("b",res));
+ return HandleErrors(PyBool_FromLong(res));
}
/*}}}*/
// arFindMember - Find member in AR archive /*{{{*/
@@ -136,12 +136,12 @@ static PyObject *arCheckMember(PyObject *Self,PyObject *Args)
FileFd Fd(fileno,false);
ARArchive AR(Fd);
if (_error->PendingError() == true)
- return HandleErrors(Py_BuildValue("b",res));
+ return HandleErrors();
if(AR.FindMember(Member) != 0)
res = true;
- return HandleErrors(Py_BuildValue("b",res));
+ return HandleErrors(PyBool_FromLong(res));
}
/*}}}*/