summaryrefslogtreecommitdiff
path: root/python/cache.cc
diff options
context:
space:
mode:
authorEmanuele Rocca <ema@debian.org>2008-07-21 17:30:43 +0200
committerEmanuele Rocca <ema@debian.org>2008-07-21 17:30:43 +0200
commitf05130ee834d60bbcf4245185886342584a3a4f9 (patch)
tree5de9a3dfb2acf3d1728092e09ceaf06d2dbf48cb /python/cache.cc
parente365aa1c9166eb6228cc84818ae3dfa075908420 (diff)
downloadpython-apt-f05130ee834d60bbcf4245185886342584a3a4f9.tar.gz
* 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)
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) {