summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornfnty <git@nfnty.se>2017-02-04 21:14:39 +0100
committernfnty <git@nfnty.se>2017-02-04 21:14:39 +0100
commitea644e52983dccbcda460b40991dd51662db819c (patch)
tree3c841f99233e89119e299cb643e5977ceac8857c
parent1f7e0890bbdf64d83e0537348679e8f916f6048b (diff)
downloadranger-ea644e52983dccbcda460b40991dd51662db819c.tar.gz
api.commands: CommandFunction: Can't set `__doc__` after creation on Python 2
-rw-r--r--ranger/api/commands.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/ranger/api/commands.py b/ranger/api/commands.py
index ba171553..7f5ce810 100644
--- a/ranger/api/commands.py
+++ b/ranger/api/commands.py
@@ -375,6 +375,8 @@ def command_alias_factory(name, cls, full_command):
def command_function_factory(func):
class CommandFunction(Command):
+ __doc__ = func.__doc__
+
def execute(self): # pylint: disable=too-many-branches
if not func:
return
@@ -422,7 +424,6 @@ def command_function_factory(func):
self.fm.notify("Bad arguments for %s: %s, %s" % (func.__name__, args, kwargs),
bad=True)
- CommandFunction.__doc__ = func.__doc__
CommandFunction.__name__ = func.__name__
return CommandFunction