summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2009-10-28 19:06:49 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2009-10-28 19:06:49 +0100
commit18e9800bb962072e79e99f8fb1a29692919596ee (patch)
tree92b41bba2f33342b78e39e8fc10e3f5c633ed192 /python
parent280cd2c72d51fcb7690a2e83f31fe7ef65a86670 (diff)
downloadpython-apt-18e9800bb962072e79e99f8fb1a29692919596ee.tar.gz
* python/progress.cc:
- if the mediaChange() does not return anything or is not implemented send "false" to libapt
Diffstat (limited to 'python')
-rw-r--r--python/progress.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/python/progress.cc b/python/progress.cc
index b3e06b87..82967687 100644
--- a/python/progress.cc
+++ b/python/progress.cc
@@ -104,11 +104,10 @@ bool PyFetchProgress::MediaChange(string Media, string Drive)
RunSimpleCallback("mediaChange", arglist, &result);
bool res = true;
- if(!PyArg_Parse(result, "b", &res))
- std::cerr << "result could not be parsed" << std::endl;
-
- // FIXME: find out what it should return usually
- //std::cerr << "res is: " << res << std::endl;
+ if(!PyArg_Parse(result, "b", &res)) {
+ // no return value or None, assume false
+ return false;
+ }
PyCbObj_BEGIN_ALLOW_THREADS
return res;