From ef31157f5e88f9eafd3f45b0cbf3b0df324a677b Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 14 Sep 2014 22:09:01 +0200 Subject: [PATCH] cmdutils: Use inspect.getdoc --- qutebrowser/commands/cmdutils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qutebrowser/commands/cmdutils.py b/qutebrowser/commands/cmdutils.py index 4afdd3462..8f094d98b 100644 --- a/qutebrowser/commands/cmdutils.py +++ b/qutebrowser/commands/cmdutils.py @@ -225,8 +225,9 @@ class register: # pylint: disable=invalid-name raise ValueError("{} is a class method, but instance was not " "given!".format(self.name[0])) has_count = 'count' in signature.parameters - if self.func.__doc__ is not None: - desc = self.func.__doc__.splitlines()[0].strip() + doc = inspect.getdoc(self.func) + if doc is not None: + desc = doc.splitlines()[0].strip() else: desc = "" if not self.ignore_args: