summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1999-03-11 16:37:13 (GMT)
committerGuido van Rossum <guido@python.org>1999-03-11 16:37:13 (GMT)
commitb62e877631dab6c00a8ce519c2aeac521ae13ea2 (patch)
tree64f23d02b47d8bf3805ffe5de203f6fa7038d057
parentcbd987040e1d7ac342d336c8a60507c2a950dbd9 (diff)
downloadcpython-b62e877631dab6c00a8ce519c2aeac521ae13ea2.zip
cpython-b62e877631dab6c00a8ce519c2aeac521ae13ea2.tar.gz
cpython-b62e877631dab6c00a8ce519c2aeac521ae13ea2.tar.bz2
- Don't crash in the case where a superclass is a string instead of a
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!).
-rw-r--r--Tools/idle/PathBrowser.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/Tools/idle/PathBrowser.py b/Tools/idle/PathBrowser.py
index 06c9ff7..d8f5b55 100644
--- a/Tools/idle/PathBrowser.py
+++ b/Tools/idle/PathBrowser.py
@@ -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))