From 654387efbd9ba363a1911e493a8477f15608e1a0 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 18 Dec 1998 15:52:54 +0000 Subject: Fix the class browser to work even when the file is not on sys.path. --- Tools/idle/ClassBrowser.py | 4 ++-- Tools/idle/FileList.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Tools/idle/ClassBrowser.py b/Tools/idle/ClassBrowser.py index ffbf508..21ff22e 100644 --- a/Tools/idle/ClassBrowser.py +++ b/Tools/idle/ClassBrowser.py @@ -20,10 +20,10 @@ from ScrolledList import ScrolledList class ClassBrowser: - def __init__(self, flist, name): + def __init__(self, flist, name, path=[]): root = flist.root try: - dict = pyclbr.readmodule(name) + dict = pyclbr.readmodule(name, path) except ImportError, msg: tkMessageBox.showerror("Import error", str(msg), parent=root) return diff --git a/Tools/idle/FileList.py b/Tools/idle/FileList.py index bebf7427..d9378e3 100644 --- a/Tools/idle/FileList.py +++ b/Tools/idle/FileList.py @@ -76,7 +76,7 @@ class MultiEditorWindow(EditorWindow): if pyclbr._modules.has_key(base): del pyclbr._modules[base] import ClassBrowser - ClassBrowser.ClassBrowser(self.flist, base) + ClassBrowser.ClassBrowser(self.flist, base, [head]) class FileList: -- cgit v0.12