Kaydet (Commit) cdf41ba9 authored tarafından Kurt B. Kaiser's avatar Kurt B. Kaiser

If an extension can't be loaded, print warning and skip it instead of

erroring out.
üst 63710396
...@@ -744,7 +744,11 @@ class EditorWindow: ...@@ -744,7 +744,11 @@ class EditorWindow:
return idleConf.GetExtensions(editor_only=True) return idleConf.GetExtensions(editor_only=True)
def load_extension(self, name): 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 None
cls = getattr(mod, name) cls = getattr(mod, name)
keydefs = idleConf.GetExtensionBindings(name) keydefs = idleConf.GetExtensionBindings(name)
if hasattr(cls, "menudefs"): if hasattr(cls, "menudefs"):
......
...@@ -3,6 +3,9 @@ What's New in IDLE 1.1.1? ...@@ -3,6 +3,9 @@ What's New in IDLE 1.1.1?
*Release date: XX-JAN-2005* *Release date: XX-JAN-2005*
- If an extension can't be loaded, print warning and skip it instead of
erroring out.
- Improve error handling when .idlerc can't be created (warn and exit) - Improve error handling when .idlerc can't be created (warn and exit)
- The GUI was hanging if the shell window was closed while a raw_input() - The GUI was hanging if the shell window was closed while a raw_input()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment