Fix broken logic in InheritDeprecated.
authorZac Medico <zmedico@gentoo.org>
Sun, 22 Aug 2010 20:16:21 +0000 (13:16 -0700)
committerZac Medico <zmedico@gentoo.org>
Sun, 22 Aug 2010 20:16:21 +0000 (13:16 -0700)
pym/repoman/checks.py

index 732559958e5c717276c19816276b8dcb78008dd5..7a6edd176c7f8d25896b09e6d4e63db9019854b0 100644 (file)
@@ -395,8 +395,10 @@ class InheritDeprecated(LineCheck):
                        return
 
                for eclass in direct_inherits:
-                       replacement = self.deprecated_classes[eclass]
-                       if replacement is False:
+                       replacement = self.deprecated_classes.get(eclass)
+                       if replacement is None:
+                               pass
+                       elif replacement is False:
                                self._indirect_deprecated.discard(eclass)
                                self._errors.append("please migrate from " + \
                                        "'%s' (no replacement) on line: %d" % (eclass, num + 1))
@@ -412,10 +414,8 @@ class InheritDeprecated(LineCheck):
                del self._errors
 
                for eclass in self._indirect_deprecated:
-                       replacement = self.deprecated_classes.get(eclass)
-                       if replacement is None:
-                               pass
-                       elif replacement is False:
+                       replacement = self.deprecated_classes[eclass]
+                       if replacement is False:
                                yield "please migrate from indirect " + \
                                        "inherit of '%s' (no replacement)" % (eclass,)
                        else: