diff options
author | Kurt B. Kaiser <kbk@shore.net> | 2005-01-18 00:54:58 (GMT) |
---|---|---|
committer | Kurt B. Kaiser <kbk@shore.net> | 2005-01-18 00:54:58 (GMT) |
commit | b00e89faab0d69feb040118bbc5ea6149e91867f (patch) | |
tree | 1862b6043f8088edae46b210a8bb038ac6e0a0fe /Lib/idlelib | |
parent | ff59f3c416a903179ea0b08db7575eddfde65ceb (diff) | |
download | cpython-b00e89faab0d69feb040118bbc5ea6149e91867f.zip cpython-b00e89faab0d69feb040118bbc5ea6149e91867f.tar.gz cpython-b00e89faab0d69feb040118bbc5ea6149e91867f.tar.bz2 |
If an extension can't be loaded, print warning and skip it instead of
erroring out.
Diffstat (limited to 'Lib/idlelib')
-rw-r--r-- | Lib/idlelib/EditorWindow.py | 7 | ||||
-rw-r--r-- | Lib/idlelib/NEWS.txt | 5 |
2 files changed, 9 insertions, 3 deletions
diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py index 4015c9e..5e0a571 100644 --- a/Lib/idlelib/EditorWindow.py +++ b/Lib/idlelib/EditorWindow.py @@ -744,7 +744,11 @@ class EditorWindow(object): return idleConf.GetExtensions(editor_only=True) def load_extension(self, name): - mod = __import__(name, globals(), locals(), []) + try: + mod = __import__(name, globals(), locals(), []) + except ImportError: + print "\nFailed to import extension: ", name + return cls = getattr(mod, name) keydefs = idleConf.GetExtensionBindings(name) if hasattr(cls, "menudefs"): @@ -762,7 +766,6 @@ class EditorWindow(object): methodname = methodname + "_event" if hasattr(ins, methodname): self.text.bind(vevent, getattr(ins, methodname)) - return ins def apply_bindings(self, keydefs=None): if keydefs is None: diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt index 4bd5786..5eca893 100644 --- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -3,6 +3,9 @@ What's New in IDLE 1.2a0? *Release date: XX-XXX-2005* +- If an extension can't be loaded, print warning and skip it instead of + erroring out. + - The GUI was hanging if the shell window was closed while a raw_input() was pending. Restored the quit() of the readline() mainloop(). http://mail.python.org/pipermail/idle-dev/2004-December/002307.html @@ -142,7 +145,7 @@ What's New in IDLE 1.0? *Release date: 29-Jul-2003* -- Added a banner to the shell discussimg warnings possibly raised by personal +- Added a banner to the shell discussing warnings possibly raised by personal firewall software. Added same comment to README.txt. |