summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog3
-rw-r--r--python/progress.cc9
2 files changed, 7 insertions, 5 deletions
diff --git a/debian/changelog b/debian/changelog
index 78d90b52..48d5b78d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,9 @@ python-apt (0.7.13.4) UNRELEASED; urgency=low
* po/zh_CN.po:
- updated, thanks to Feng Chao
+ * python/progress.cc:
+ - if the mediaChange() does not return anything or is not implemented
+ send "false" to libapt
-- Michael Vogt <michael.vogt@ubuntu.com> Wed, 23 Sep 2009 15:32:13 +0200
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;