From 1da9275d2c3e94f4c28302d0580f4d7a8fe8ebb3 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 19 Jun 2012 10:48:45 +0200 Subject: python/acquire.cc: Use pkgAcquire::Setup() to setup the acquire class and handle errors from this (Closes: #629624) --- python/acquire.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'python') 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(NULL, type, fetcher); if (progress != 0) progress->setPyAcquire(FetcherObj); // prepare our map of items. - return FetcherObj; + return HandleErrors(FetcherObj); } /** -- cgit v1.2.3