summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog12
-rw-r--r--python/depcache.cc3
-rw-r--r--python/generic.h4
-rw-r--r--tests/test_all.py8
4 files changed, 25 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog
index 4c320ba0..f55369d7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+python-apt (0.7.100ubuntu2) UNRELEASED; urgency=low
+
+ * python/generic.h:
+ - set Object to NULL in CppDeallocPtr
+ * python/depcache.cc:
+ - don't run "actiongroup.release()" if the object was already
+ deallocated
+
+ -- Michael Vogt <michael.vogt@ubuntu.com> Tue, 07 Dec 2010 13:41:07 +0100
+
python-apt (0.7.100ubuntu1) natty; urgency=low
* re-merged from debian/sid
@@ -86,6 +96,8 @@ python-apt (0.7.98) unstable; urgency=low
- do use PyString_FromFormat(), in python versions below 2.7 it
does not support long long (%llu), use strprintf() from libapt
instead
+ * tests/test_apt_cache.py:
+ - fix tests to work if apt compressed indexes are enabled
[ Kiwinote ]
* apt/debfile:
diff --git a/python/depcache.cc b/python/depcache.cc
index b7294644..014ad7ae 100644
--- a/python/depcache.cc
+++ b/python/depcache.cc
@@ -997,7 +997,8 @@ static const char *actiongroup__exit__doc =
"Same as release(), but for use as a context manager.";
static PyObject *PkgActionGroupExit(PyObject *Self,PyObject *Args) {
pkgDepCache::ActionGroup *ag = GetCpp<pkgDepCache::ActionGroup*>(Self);
- ag->release();
+ if (ag != NULL)
+ ag->release();
Py_RETURN_FALSE;
}
diff --git a/python/generic.h b/python/generic.h
index 31c1bc2d..7abf7e7a 100644
--- a/python/generic.h
+++ b/python/generic.h
@@ -202,8 +202,10 @@ void CppDeallocPtr(PyObject *iObj)
std::cerr << "=== DEALLOCATING " << iObj->ob_type->tp_name << "*+ ===\n";
#endif
CppPyObject<T> *Obj = (CppPyObject<T> *)iObj;
- if (!((CppPyObject<T>*)Obj)->NoDelete)
+ if (!((CppPyObject<T>*)Obj)->NoDelete) {
delete Obj->Object;
+ Obj->Object = NULL;
+ }
CppClear<T>(iObj);
iObj->ob_type->tp_free(iObj);
}
diff --git a/tests/test_all.py b/tests/test_all.py
index d6370747..091581f8 100644
--- a/tests/test_all.py
+++ b/tests/test_all.py
@@ -9,6 +9,14 @@ import os
import unittest
import sys
+# workaround for py3.2 that apparently does not have this anymore
+# it has "abiflags"
+if not hasattr(sys, "pydebug"):
+ if sys.abiflags.startswith("d"):
+ sys.pydebug = True
+ else:
+ sys.pydebug = False
+
def get_library_dir():
# Find the path to the built apt_pkg and apt_inst extensions
if not os.path.exists("../build"):