summaryrefslogtreecommitdiff
path: root/python/cache.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2008-07-22 15:58:48 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2008-07-22 15:58:48 +0200
commit268c7947aa2311682df06bbc70a7c3f5f20d9c1f (patch)
treead303143996714c98428ec1a02b07162fd6d6403 /python/cache.cc
parent989851644e18c6ff446155b5f19d57df2b834253 (diff)
parent5d8dd13ab3d1e6845a061a4d5b871dda87ab4753 (diff)
downloadpython-apt-268c7947aa2311682df06bbc70a7c3f5f20d9c1f.tar.gz
* merged from debian-sid
* data/templates/Debian.info.in: - s/MatchUri/MatchURI/. Thanks, Gustavo Noronha Silva (closes: #487673) * python/cache.cc: - Throw an exception rather than segfaulting when GetCache() is called before InitSystem() (closes: #369147) * doc/examples/config.py: - Fix config.py --help (closes: #257007) * python/apt_pkgmodule.cc: - fix bug in hashsum calculation when the original string contains \0 charackters (thanks to Celso Providelo and Ryan Hass for the test-case) LP: #243630 * tests/test_hashsums.py: - add tests for the hashsum code * apt/package.py: - add "isAutoRemovable()" method * python/pkgsrcrecords.cc: - add "Record" attribute to the PkgSrcRecord to access the full source record * debian/rules: - remove the arch-build target, we have bzr-builddeb now
Diffstat (limited to 'python/cache.cc')
-rw-r--r--python/cache.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/python/cache.cc b/python/cache.cc
index 36e49710..66a2c5d9 100644
--- a/python/cache.cc
+++ b/python/cache.cc
@@ -928,6 +928,11 @@ PyObject *TmpGetCache(PyObject *Self,PyObject *Args)
if (PyArg_ParseTuple(Args, "|O", &pyCallbackInst) == 0)
return 0;
+ if (_system == 0) {
+ PyErr_SetString(PyExc_ValueError,"_system not initialized");
+ return 0;
+ }
+
pkgCacheFile *Cache = new pkgCacheFile();
if(pyCallbackInst != 0) {