]> granicus.if.org Git - python/commitdiff
- Don't crash in the case where a superclass is a string instead of a
authorGuido van Rossum <guido@python.org>
Thu, 11 Mar 1999 16:37:13 +0000 (16:37 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 11 Mar 1999 16:37:13 +0000 (16:37 +0000)
pyclbr.Class object; this can happen when the superclass is
unrecognizable (to pyclbr), e.g. when module renaming is used.

- Show a watch cursor when calling pyclbr (since it may take a while
recursively parsing imported modules!).

Tools/idle/PathBrowser.py

index 06c9ff7fae4c8294ab8f51018d912882591dc3a1..d8f5b55169af8c39dfe3c3fc4c4e8de29daafd87 100644 (file)
@@ -78,7 +78,12 @@ class PathBrowser(MultiScrolledLists):
             self.top.bell()
             return []
         try:
-            dict = pyclbr.readmodule(name, [dir] + sys.path)
+            self.top.configure(cursor="watch")
+            self.top.update_idletasks()
+            try:
+                dict = pyclbr.readmodule(name, [dir] + sys.path)
+            finally:
+                self.top.configure(cursor="")
         except ImportError, msg:
             tkMessageBox.showerror("Import error", str(msg), parent=root)
             return []
@@ -90,9 +95,12 @@ class PathBrowser(MultiScrolledLists):
                 if cl.super:
                     supers = []
                     for sup in cl.super:
-                        sname = sup.name
-                        if sup.module != cl.module:
-                            sname = "%s.%s" % (sup.module, sname)
+                        if type(sup) is type(''):
+                            sname = sup
+                        else:
+                            sname = sup.name
+                            if sup.module != cl.module:
+                                sname = "%s.%s" % (sup.module, sname)
                         supers.append(sname)
                     s = s + "(%s)" % string.join(supers, ", ")
                 items.append((cl.lineno, s))