summaryrefslogtreecommitdiff
path: root/aptsources/distinfo.py
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2007-02-13 18:36:57 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2007-02-13 18:36:57 +0100
commit4d7d86374effe9bfd3a360aaaa7b09758f5c948e (patch)
tree3ab29d32f4c1bd6adfd64b135f5e672c26637d00 /aptsources/distinfo.py
parenta4bee532559a5022e54dac4cfbd9da23c7434a2f (diff)
downloadpython-apt-4d7d86374effe9bfd3a360aaaa7b09758f5c948e.tar.gz
* fixed crash in Mirror.has_repository
* fixed docstring
Diffstat (limited to 'aptsources/distinfo.py')
-rw-r--r--aptsources/distinfo.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/aptsources/distinfo.py b/aptsources/distinfo.py
index f3c68cae..261243b4 100644
--- a/aptsources/distinfo.py
+++ b/aptsources/distinfo.py
@@ -91,8 +91,12 @@ class Mirror:
def get_repositories_for_proto(self, proto):
return filter(lambda r: r.proto == proto, self.repositories)
def has_repository(self, proto, dir):
- return len(filter(lambda r: (r.proto == proto) and dir in r.dir,
- self.repositories)) > 0
+ if dir is None:
+ return False
+ for r in self.repositories:
+ if r.proto == proto and dir in r.dir:
+ return True
+ return False
def get_repo_urls(self):
return map(lambda r: r.get_url(self.hostname), self.repositories)
def get_location(self):