summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2010-07-28 11:09:00 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2010-07-28 11:09:00 +0200
commitcee5d33d44130ce8ceb7b563f7b97f2bf9a3ca5c (patch)
tree8157a049457a566f6ac5b2e665cba01629aadd58 /python
parent3b4330920da718d2dbb2a4a94577c07eaa58a8c5 (diff)
parentd642c9ea22f5705acfcba79493f48293626771c3 (diff)
downloadpython-apt-cee5d33d44130ce8ceb7b563f7b97f2bf9a3ca5c.tar.gz
merged from the debian-sid bzr branch
Diffstat (limited to 'python')
-rw-r--r--python/apt_pkgmodule.cc2
-rw-r--r--python/progress.cc5
-rw-r--r--python/tag.cc5
3 files changed, 11 insertions, 1 deletions
diff --git a/python/apt_pkgmodule.cc b/python/apt_pkgmodule.cc
index a1e9ada0..cacbf77a 100644
--- a/python/apt_pkgmodule.cc
+++ b/python/apt_pkgmodule.cc
@@ -905,6 +905,8 @@ extern "C" void initapt_pkg()
Py_BuildValue("i", pkgAcquire::Item::StatFetching));
PyDict_SetItemString(PyAcquireItem_Type.tp_dict, "STAT_DONE",
Py_BuildValue("i", pkgAcquire::Item::StatDone));
+ PyDict_SetItemString(PyAcquireItem_Type.tp_dict, "STAT_TRANSIENT_NETWORK_ERROR",
+ Py_BuildValue("i", pkgAcquire::Item::StatTransientNetworkError));
PyDict_SetItemString(PyAcquireItem_Type.tp_dict, "STAT_ERROR",
Py_BuildValue("i", pkgAcquire::Item::StatError));
PyDict_SetItemString(PyAcquireItem_Type.tp_dict, "STAT_AUTH_ERROR",
diff --git a/python/progress.cc b/python/progress.cc
index 9002b3eb..437309cf 100644
--- a/python/progress.cc
+++ b/python/progress.cc
@@ -300,7 +300,10 @@ bool PyFetchProgress::Pulse(pkgAcquire * Owner)
Py_INCREF(pyAcquire);
if (RunSimpleCallback("pulse", TUPLEIZE(pyAcquire) , &result1)) {
- if (result1 != NULL && PyArg_Parse(result1, "b", &res1) && res1 == false) {
+ if (result1 != NULL &&
+ result1 != Py_None &&
+ PyArg_Parse(result1, "b", &res1) &&
+ res1 == false) {
// the user returned a explicit false here, stop
PyCbObj_BEGIN_ALLOW_THREADS
return false;
diff --git a/python/tag.cc b/python/tag.cc
index 9fe12a1a..97039bc4 100644
--- a/python/tag.cc
+++ b/python/tag.cc
@@ -393,7 +393,12 @@ static PyObject *TagFileNew(PyTypeObject *type,PyObject *Args,PyObject *kwds)
return 0;
TagFileData *New = (TagFileData*)type->tp_alloc(type, 0);
+#ifdef APT_HAS_GZIP
+ new (&New->Fd) FileFd();
+ New->Fd.OpenDescriptor(fileno, FileFd::ReadOnlyGzip, false);
+#else
new (&New->Fd) FileFd(fileno,false);
+#endif
New->Owner = File;
Py_INCREF(New->Owner);
new (&New->Object) pkgTagFile(&New->Fd);