[Python-checkins] python/dist/src/Lib pydoc.py,1.56.8.4,1.56.8.5

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
Mon, 07 Oct 2002 06:24:04 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv21949

Modified Files:
      Tag: release22-maint
	pydoc.py 
Log Message:
Backport 1.63:

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.


Index: pydoc.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/pydoc.py,v
retrieving revision 1.56.8.4
retrieving revision 1.56.8.5
diff -C2 -d -r1.56.8.4 -r1.56.8.5
*** pydoc.py	26 Sep 2002 21:50:01 -0000	1.56.8.4
--- pydoc.py	7 Oct 2002 13:24:02 -0000	1.56.8.5
***************
*** 675,679 ****
                  for name, kind, homecls, value in ok:
                      base = self.docother(getattr(object, name), name, mod)
!                     doc = getattr(value, "__doc__", None)
                      if doc is None:
                          push('<dl><dt>%s</dl>\n' % base)
--- 675,682 ----
                  for name, kind, homecls, value in ok:
                      base = self.docother(getattr(object, name), name, mod)
!                     if callable(value):
!                         doc = getattr(value, "__doc__", None)
!                     else:
!                         doc = None
                      if doc is None:
                          push('<dl><dt>%s</dl>\n' % base)
***************
*** 1067,1071 ****
                  push(msg)
                  for name, kind, homecls, value in ok:
!                     doc = getattr(value, "__doc__", None)
                      push(self.docother(getattr(object, name),
                                         name, mod, 70, doc) + '\n')
--- 1070,1077 ----
                  push(msg)
                  for name, kind, homecls, value in ok:
!                     if callable(value):
!                         doc = getattr(value, "__doc__", None)
!                     else:
!                         doc = None
                      push(self.docother(getattr(object, name),
                                         name, mod, 70, doc) + '\n')