summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2012-06-19 10:48:45 +0200
committerJulian Andres Klode <jak@debian.org>2012-06-19 10:48:45 +0200
commit1da9275d2c3e94f4c28302d0580f4d7a8fe8ebb3 (patch)
tree279bcf695a98b4ab60dcd087bc497464fa2578eb
parent4133baa95eaf2a8638c2ad8acea42e061049db02 (diff)
downloadpython-apt-1da9275d2c3e94f4c28302d0580f4d7a8fe8ebb3.tar.gz
python/acquire.cc: Use pkgAcquire::Setup() to setup the acquire class
and handle errors from this (Closes: #629624)
-rw-r--r--debian/changelog3
-rw-r--r--python/acquire.cc9
2 files changed, 7 insertions, 5 deletions
diff --git a/debian/changelog b/debian/changelog
index 771fed36..20bf1b0b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -49,6 +49,9 @@ python-apt (0.8.5) UNRELEASED; urgency=low
a segmentation fault (Closes: #661062)
* python/tag.cc:
- Correctly handle file descriptor 0 aka stdin (Closes: #669458)
+ * python/acquire.cc:
+ - Use pkgAcquire::Setup() to setup the acquire class and handle errors
+ from this (Closes: #629624)
-- Michael Vogt <mvo@debian.org> Tue, 17 Apr 2012 14:09:24 +0200
diff --git a/python/acquire.cc b/python/acquire.cc
index 6169ff40..45b4493c 100644
--- a/python/acquire.cc
+++ b/python/acquire.cc
@@ -328,18 +328,17 @@ static PyObject *PkgAcquireNew(PyTypeObject *type,PyObject *Args,PyObject *kwds)
// FIXME: memleak?
progress = new PyFetchProgress();
progress->setCallbackInst(pyFetchProgressInst);
- fetcher = new pkgAcquire(progress);
- }
- else {
- fetcher = new pkgAcquire();
}
+ fetcher = new pkgAcquire();
+ fetcher->Setup(progress);
+
PyObject *FetcherObj = CppPyObject_NEW<pkgAcquire*>(NULL, type, fetcher);
if (progress != 0)
progress->setPyAcquire(FetcherObj);
// prepare our map of items.
- return FetcherObj;
+ return HandleErrors(FetcherObj);
}
/**