]> err.no Git - dak/commitdiff
Remove one level of indentation by using continue
authorChris Lamb <lamby@debian.org>
Tue, 27 Oct 2009 19:37:44 +0000 (19:37 +0000)
committerChris Lamb <lamby@debian.org>
Tue, 27 Oct 2009 19:45:02 +0000 (19:45 +0000)
Signed-off-by: Chris Lamb <lamby@debian.org>
daklib/queue.py

index c2377294778ac96e3e55d463bf0e06661fb8c616..bde44c17a34ecc4a15f72fa146c737eaf26f16ac 100755 (executable)
@@ -1252,31 +1252,33 @@ class Upload(object):
             # W: tzdata: binary-without-manpage usr/sbin/tzconfig
             for line in output.split('\n'):
                 m = re_parse_lintian.match(line)
-                if m:
-                    etype = m.group(1)
-                    epackage = m.group(2)
-                    etag = m.group(3)
-                    etext = m.group(4)
-
-                    # So lets check if we know the tag at all.
-                    if etag in tags:
-                        if etype == 'O':
-                            # We know it and it is overriden. Check that override is allowed.
-                            if lintiantags['warning'][etag]:
-                                # The tag is overriden, and it is allowed to be overriden.
-                                # Continue as if it isnt there.
-                                next
-                            elif lintiantags['error'][etag]:
-                                # The tag is overriden - but is not allowed to be
-                                self.rejects.append("%s: Overriden tag %s found, but this tag may not be overwritten." % (epackage, etag))
-                                return
-                        else:
-                            # Tag is known, it is not overriden, direct reject.
-                            self.rejects.append("%s: Found lintian output: '%s %s', automatically rejected package." % (epackage, etag, etext))
-                            # Now tell if they *might* override it.
-                            if lintiantags['wayout'][etag]:
-                                self.rejects.append("%s: If you have a good reason, you may override this lintian tag. Laziness to fix your crap is NOT A GOOD REASON, sod off" % (epackage))
+                if m is None:
+                    continue
+
+                etype = m.group(1)
+                epackage = m.group(2)
+                etag = m.group(3)
+                etext = m.group(4)
+
+                # So lets check if we know the tag at all.
+                if etag in tags:
+                    if etype == 'O':
+                        # We know it and it is overriden. Check that override is allowed.
+                        if lintiantags['warning'][etag]:
+                            # The tag is overriden, and it is allowed to be overriden.
+                            # Continue as if it isnt there.
+                            next
+                        elif lintiantags['error'][etag]:
+                            # The tag is overriden - but is not allowed to be
+                            self.rejects.append("%s: Overriden tag %s found, but this tag may not be overwritten." % (epackage, etag))
                             return
+                    else:
+                        # Tag is known, it is not overriden, direct reject.
+                        self.rejects.append("%s: Found lintian output: '%s %s', automatically rejected package." % (epackage, etag, etext))
+                        # Now tell if they *might* override it.
+                        if lintiantags['wayout'][etag]:
+                            self.rejects.append("%s: If you have a good reason, you may override this lintian tag. Laziness to fix your crap is NOT A GOOD REASON, sod off" % (epackage))
+                        return
 
     ###########################################################################
     def check_urgency(self):