From 6909a3c4487d69e0d59ac9ac1b1a731c85f27cc4 2008-09-18 17:02:30 From: Ville M. Vainio Date: 2008-09-18 17:02:30 Subject: [PATCH] Fix #270998: A magic with no docstring breaks the '%magic magic' --- diff --git a/IPython/Magic.py b/IPython/Magic.py index b0fdcb9..93ec51c 100644 --- a/IPython/Magic.py +++ b/IPython/Magic.py @@ -422,7 +422,11 @@ python-profiler package from non-free.""") else: fndoc = 'No documentation' else: - fndoc = fn.__doc__.rstrip() + if fn.__doc__: + fndoc = fn.__doc__.rstrip() + else: + fndoc = 'No documentation' + if mode == 'rest': rest_docs.append('**%s%s**::\n\n\t%s\n\n' %(self.shell.ESC_MAGIC,