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

erroring out.
This commit is contained in:
Kurt B. Kaiser
2005-01-19 17:25:05 +00:00
parent 6371039655
commit cdf41ba9ef
2 changed files with 8 additions and 1 deletions

View File

@@ -744,7 +744,11 @@ class EditorWindow:
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 None
cls = getattr(mod, name)
keydefs = idleConf.GetExtensionBindings(name)
if hasattr(cls, "menudefs"):

View File

@@ -3,6 +3,9 @@ What's New in IDLE 1.1.1?
*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)
- The GUI was hanging if the shell window was closed while a raw_input()