diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2009-10-28 19:06:49 +0100 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2009-10-28 19:06:49 +0100 |
| commit | 18e9800bb962072e79e99f8fb1a29692919596ee (patch) | |
| tree | 92b41bba2f33342b78e39e8fc10e3f5c633ed192 | |
| parent | 280cd2c72d51fcb7690a2e83f31fe7ef65a86670 (diff) | |
| download | python-apt-18e9800bb962072e79e99f8fb1a29692919596ee.tar.gz | |
* python/progress.cc:
- if the mediaChange() does not return anything or is not implemented
send "false" to libapt
| -rw-r--r-- | debian/changelog | 3 | ||||
| -rw-r--r-- | python/progress.cc | 9 |
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; |
