diff options
| author | Julian Andres Klode <jak@debian.org> | 2012-06-19 10:48:45 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2012-06-19 10:48:45 +0200 |
| commit | 1da9275d2c3e94f4c28302d0580f4d7a8fe8ebb3 (patch) | |
| tree | 279bcf695a98b4ab60dcd087bc497464fa2578eb /python | |
| parent | 4133baa95eaf2a8638c2ad8acea42e061049db02 (diff) | |
| download | python-apt-1da9275d2c3e94f4c28302d0580f4d7a8fe8ebb3.tar.gz | |
python/acquire.cc: Use pkgAcquire::Setup() to setup the acquire class
and handle errors from this (Closes: #629624)
Diffstat (limited to 'python')
| -rw-r--r-- | python/acquire.cc | 9 |
1 files changed, 4 insertions, 5 deletions
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); } /** |
