Kaydet (Commit) 9075cc46 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 b7af39c4
...@@ -770,7 +770,11 @@ class EditorWindow: ...@@ -770,7 +770,11 @@ class EditorWindow:
return idleConf.GetExtensions() return idleConf.GetExtensions()
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)
ins = cls(self) ins = cls(self)
self.extensions[name] = ins self.extensions[name] = ins
......
...@@ -3,6 +3,9 @@ What's New in IDLE 1.0.4? ...@@ -3,6 +3,9 @@ What's New in IDLE 1.0.4?
*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. This is a partial - Improve error handling when .idlerc can't be created. This is a partial
backport of configHandler.py, Revision 1.36, 11Jan05. backport of configHandler.py, Revision 1.36, 11Jan05.
......
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