Return boolean types from is_ methods
authorGuido Günther <agx@sigxcpu.org>
Fri, 22 Mar 2013 16:47:07 +0000 (17:47 +0100)
committerGuido Günther <agx@sigxcpu.org>
Fri, 22 Mar 2013 17:01:20 +0000 (18:01 +0100)
instead of a match object or None

gbp/pkg/__init__.py

index d128feb..6d8fee9 100644 (file)
@@ -38,12 +38,14 @@ class PkgPolicy(object):
     @classmethod
     def is_valid_packagename(cls, name):
         "Is this a valid package name?"
-        return cls.packagename_re.match(name)
+        return True if cls.packagename_re.match(name) else False
 
     @classmethod
     def is_valid_upstreamversion(cls, version):
-        "Is this a valid upstream version number?"
-        return cls.upstreamversion_re.match(version)
+        """
+        Is this a valid upstream version number?
+        """
+        return True if cls.upstreamversion_re.match(version) else False
 
     @staticmethod
     def get_compression(orig_file):