From ea644e52983dccbcda460b40991dd51662db819c Mon Sep 17 00:00:00 2001 From: nfnty Date: Sat, 4 Feb 2017 21:14:39 +0100 Subject: api.commands: CommandFunction: Can't set `__doc__` after creation on Python 2 --- ranger/api/commands.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ranger/api/commands.py') 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 -- cgit 1.4.1-2-gfad0