diff options
author | Guido van Rossum <guido@python.org> | 1999-06-01 18:27:14 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1999-06-01 18:27:14 (GMT) |
commit | 74311b2c27f50157f644a01a7bee937cd5414533 (patch) | |
tree | 380727b8ef9bf958ec5fb25d5b08b4f113064412 | |
parent | 292dd2d1afdabd35c6ea3f746539ce2b01930a23 (diff) | |
download | cpython-74311b2c27f50157f644a01a7bee937cd5414533.zip cpython-74311b2c27f50157f644a01a7bee937cd5414533.tar.gz cpython-74311b2c27f50157f644a01a7bee937cd5414533.tar.bz2 |
1. Catch NameError on import (could be raised by case mismatch on Windows).
2. No longer need to reset pyclbr cache and show watch cursor when calling
ClassBrowser -- the ClassBrowser takes care of pyclbr and the TreeWidget
takes care of the watch cursor.
3. Reset the focus to the current window after error message about class
browser on buffer without filename.
-rw-r--r-- | Tools/idle/EditorWindow.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/Tools/idle/EditorWindow.py b/Tools/idle/EditorWindow.py index 13cfc22..42e7e45 100644 --- a/Tools/idle/EditorWindow.py +++ b/Tools/idle/EditorWindow.py @@ -295,7 +295,7 @@ class EditorWindow: # XXX Ought to insert current file's directory in front of path try: (f, file, (suffix, mode, type)) = imp.find_module(name) - except ImportError, msg: + except (NameError, ImportError), msg: tkMessageBox.showerror("Import error", str(msg), parent=self.text) return if type != imp.PY_SOURCE: @@ -316,18 +316,12 @@ class EditorWindow: "No filename", "This buffer has no associated filename", master=self.text) + self.text.focus_set() return None head, tail = os.path.split(filename) base, ext = os.path.splitext(tail) - import pyclbr - if pyclbr._modules.has_key(base): - del pyclbr._modules[base] - save_cursor = self.text["cursor"] - self.text["cursor"] = "watch" - self.text.update_idletasks() import ClassBrowser ClassBrowser.ClassBrowser(self.flist, base, [head]) - self.text["cursor"] = save_cursor def open_path_browser(self, event=None): import PathBrowser |