From f82a7c7e17bf9714b5864eaecacee918ba302930 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sat, 1 Jun 2013 16:35:47 +0200 Subject: [PATCH] Issue error message at plugin load if a command has no docstring. --- src/commands.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/commands.py b/src/commands.py index 2010a61a4..0886f5857 100644 --- a/src/commands.py +++ b/src/commands.py @@ -1039,9 +1039,10 @@ class Spec(object): return state def _wrap(f, specList=[], name=None, **kw): - assert hasattr(f, '__doc__') - f = internationalizeDocstring(f) name = name or f.func_name + assert hasattr(f, '__doc__') and f.__doc__, \ + 'Command %r has no docstring.' % name + f = internationalizeDocstring(f) spec = Spec(specList, **kw) def newf(self, irc, msg, args, **kwargs): state = spec(irc, msg, args, stateAttrs={'cb': self, 'log': self.log})