summaryrefslogtreecommitdiff
path: root/python/policy.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2012-01-31 15:07:32 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2012-01-31 15:07:32 +0100
commit601d841cc3644f827487a277b5e031323450a6c4 (patch)
treebe3812288ff3f77ec53de80c5e15ff8429f73578 /python/policy.cc
parent9543d9414085ba8f9b29f8b5fe6dca72d6af5fa1 (diff)
parent64c1ffa6310efdff6353346fe621aea10e36f2c9 (diff)
downloadpython-apt-601d841cc3644f827487a277b5e031323450a6c4.tar.gz
merged from lp:~mvo/python-apt/mvo
Diffstat (limited to 'python/policy.cc')
-rw-r--r--python/policy.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/python/policy.cc b/python/policy.cc
index b11e4dde..96b83abd 100644
--- a/python/policy.cc
+++ b/python/policy.cc
@@ -46,8 +46,11 @@ PyObject *policy_get_priority(PyObject *self, PyObject *arg) {
if (PyObject_TypeCheck(arg, &PyPackage_Type)) {
pkgCache::PkgIterator pkg = GetCpp<pkgCache::PkgIterator>(arg);
return MkPyNumber(policy->GetPriority(pkg));
+ } else if (PyObject_TypeCheck(arg, &PyPackageFile_Type)) {
+ pkgCache::PkgFileIterator pkgfile = GetCpp<pkgCache::PkgFileIterator>(arg);
+ return MkPyNumber(policy->GetPriority(pkgfile));
} else {
- PyErr_SetString(PyExc_TypeError,"Argument must be of Package().");
+ PyErr_SetString(PyExc_TypeError,"Argument must be of Package() or PackageFile().");
return 0;
}
}