about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authortoonn <toonn@toonn.io>2021-07-15 20:30:14 +0200
committertoonn <toonn@toonn.io>2021-07-15 20:39:10 +0200
commit643492ea144c63db4cb13af96aa914b3e5062e97 (patch)
tree5fbb9bbff831f4359bd901fd9be87c0f21c39c7c
parent5d6b5f62e5e7f8ffbd6a68c2d66d2fc2bf5ef268 (diff)
downloadranger-643492ea144c63db4cb13af96aa914b3e5062e97.tar.gz
commands.py: Pylint doesn't like mixing im/explicit returns
-rw-r--r--ranger/api/commands.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/ranger/api/commands.py b/ranger/api/commands.py
index 90a79488..32b33e61 100644
--- a/ranger/api/commands.py
+++ b/ranger/api/commands.py
@@ -287,7 +287,7 @@ class Command(FileManagerAware):
                             if dn.startswith(rel_basename)]
         except (OSError, StopIteration):
             # os.walk found nothing
-            pass
+            return None
         else:
             dirnames.sort()
 
@@ -353,7 +353,7 @@ class Command(FileManagerAware):
                                     if name.startswith(rel_basename)])
         except (OSError, StopIteration):
             # os.walk found nothing
-            pass
+            return None
         else:
             # no results, return None
             if not names:
@@ -395,7 +395,8 @@ def command_function_factory(func):
     class CommandFunction(Command):
         __doc__ = func.__doc__
 
-        def execute(self):  # pylint: disable=too-many-branches
+        def execute(self):
+            # pylint: disable=too-many-branches,too-many-return-statements
             if not func:
                 return None
             if len(self.args) == 1:
@@ -442,6 +443,8 @@ def command_function_factory(func):
                 self.fm.notify("Bad arguments for %s: %s, %s" % (func.__name__, args, kwargs),
                                bad=True)
 
+            return None
+
     CommandFunction.__name__ = func.__name__
     return CommandFunction