[Idle-dev] CVS: idle ClassBrowser.py,1.5,1.6

Raymond Hettinger rhettinger@users.sourceforge.net
Sat, 18 Jan 2003 18:37:43 -0800


Update of /cvsroot/idlefork/idle
In directory sc8-pr-cvs1:/tmp/cvs-serv10421

Modified Files:
	ClassBrowser.py 
Log Message:
SF bug #668906: class browser raises AttributeError

The Py2.3 updates to the pyclbr module return both Class and Function
objects.  The IDLE ClassBrowser module only knew about Class and could
not handle objects which did not define "super".  

Fixed by adding a guard.


Index: ClassBrowser.py
===================================================================
RCS file: /cvsroot/idlefork/idle/ClassBrowser.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** ClassBrowser.py	3 Dec 2002 09:28:11 -0000	1.5
--- ClassBrowser.py	19 Jan 2003 02:37:41 -0000	1.6
***************
*** 99,103 ****
              if cl.module == name:
                  s = key
!                 if cl.super:
                      supers = []
                      for sup in cl.super:
--- 99,103 ----
              if cl.module == name:
                  s = key
!                 if hasattr(cl, 'super') and cl.super:
                      supers = []
                      for sup in cl.super: