From: Guido van Rossum Date: Tue, 21 May 2002 20:56:15 +0000 (+0000) Subject: In both spilldata() functions, pretend that the docstring for X-Git-Tag: v2.3c1~5626 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5e355b244ff5b76e736a949d6ee5ec4f01f0b9a0;p=thirdparty%2FPython%2Fcpython.git In both spilldata() functions, pretend that the docstring for non-callable objects is always None. This makes for less confusing output and fixes the problem reported in SF patch #550290. --- diff --git a/Lib/pydoc.py b/Lib/pydoc.py index de6fc63835ca..4cff5f3a37ae 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -675,7 +675,10 @@ TT { font-family: lucidatypewriter, lucida console, courier } push(msg) for name, kind, homecls, value in ok: base = self.docother(getattr(object, name), name, mod) - doc = getattr(value, "__doc__", None) + if callable(value): + doc = getattr(value, "__doc__", None) + else: + doc = None if doc is None: push('
%s
\n' % base) else: @@ -1067,7 +1070,10 @@ class TextDoc(Doc): hr.maybe() push(msg) for name, kind, homecls, value in ok: - doc = getattr(value, "__doc__", None) + if callable(value): + doc = getattr(value, "__doc__", None) + else: + doc = None push(self.docother(getattr(object, name), name, mod, 70, doc) + '\n') return attrs