[elbe-devel] [PATCH 27/28] pylint: db: convert "if x: return True else: False" to "return x"

Torben Hohn torben.hohn at linutronix.de
Wed Aug 22 11:29:21 CEST 2018


pylint complains abbout it, and its much simpler to just return
the result of the comparison.

fix it.

Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
---
 elbepack/db.py | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/elbepack/db.py b/elbepack/db.py
index e4371607..fe14195e 100644
--- a/elbepack/db.py
+++ b/elbepack/db.py
@@ -504,10 +504,7 @@ class ElbeDB(object):
                     "project %s is not registered in the database" %
                     builddir)
 
-            if p.status == "busy":
-                return True
-            else:
-                return False
+            return p.status == "busy"
 
     def reset_busy(self, builddir, new_status):
         assert new_status == "has_changes" or \
@@ -542,10 +539,7 @@ class ElbeDB(object):
                     "project %s is not registered in the database" %
                     builddir)
 
-            if p.status == "has_changes":
-                return True
-            else:
-                return False
+            return p.status == "has_changes"
 
     def get_owner_id(self, builddir):
         with session_scope(self.session) as s:
-- 
2.11.0




More information about the elbe-devel mailing list