From 03a5a6d295ceb2fd83df7ded4d4fb03db65e145f Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Thu, 4 Feb 2021 11:13:40 -0300 Subject: [PATCH] Fixed exception when a plug-in class doesn't have a docstring. --- kibot/config_reader.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kibot/config_reader.py b/kibot/config_reader.py index 99ca3279..bcce50ae 100644 --- a/kibot/config_reader.py +++ b/kibot/config_reader.py @@ -211,6 +211,8 @@ class CfgYamlReader(object): def trim(docstring): """ PEP 257 recommended trim for __doc__ """ + if docstring is None: + return [] # Convert tabs to spaces (following the normal Python rules) # and split into a list of lines: lines = docstring.expandtabs().splitlines() @@ -278,7 +280,7 @@ def print_output_options(name, cl, indent): def print_one_out_help(details, n, o): lines = trim(o.__doc__) if len(lines) == 0: - lines = ['Undocumented', 'No description'] # pragma: no cover (Internal) + lines = ['Undocumented', 'No description'] if details: print('* '+lines[0]) print(' * Type: `{}`'.format(n))