diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2012-08-14 14:58:25 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2012-08-14 14:58:25 +0200 |
| commit | c1ad8a0fbc0adfebdb847f28da92b3d5a1f90582 (patch) | |
| tree | 80225148a1c1d0d4283fb76e827c6ccc9ca206bf /python/policy.cc | |
| parent | c736d5c9290a2ffdb8802a4ac62e521cf1218b54 (diff) | |
| parent | dfd6bacface878eecf3fec4876bdae2f0491a646 (diff) | |
| download | python-apt-c1ad8a0fbc0adfebdb847f28da92b3d5a1f90582.tar.gz | |
merged from the debian-sid tree
Diffstat (limited to 'python/policy.cc')
| -rw-r--r-- | python/policy.cc | 5 |
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; } } |
