From: Michael Tremer Date: Sun, 7 May 2017 12:23:57 +0000 (+0200) Subject: arch: Fix typos and catch some errors X-Git-Tag: 0.9.28~1285^2~1348 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5606d342c8103a9f7747568ba94371ff4589cc27;p=pakfire.git arch: Fix typos and catch some errors Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/arch.py b/src/pakfire/arch.py index 8bebbd560..d34ed1670 100644 --- a/src/pakfire/arch.py +++ b/src/pakfire/arch.py @@ -26,8 +26,13 @@ log.propagate = 1 class Arch(object): def __init__(self, name): + assert name + self.name = name + def __repr__(self): + return "<%s %s>" % (self.__class__.__name__, self.name) + def __eq__(self, other): return self.name == other.name @@ -66,7 +71,7 @@ class Arch(object): return machine.replace("-gnu", "") @property - def compatbile_arches(self): + def compatible_arches(self): """ Returns a list of all architectures that are compatible (i.e. can be emulated) @@ -88,7 +93,7 @@ class Arch(object): } try: - return x[self.name] + return (Arch(a) for a in x[self.name]) except KeyError: return []