[Python-checkins] python/dist/src/Lib/idlelib EditorWindow.py, 1.63, 1.64 NEWS.txt, 1.51, 1.52

kbk at users.sourceforge.net kbk at users.sourceforge.net
Tue Jan 18 01:55:18 CET 2005


Update of /cvsroot/python/python/dist/src/Lib/idlelib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28685

Modified Files:
	EditorWindow.py NEWS.txt 
Log Message:
If an extension can't be loaded, print warning and skip it instead of
erroring out.


Index: EditorWindow.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/EditorWindow.py,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- EditorWindow.py	21 Dec 2004 22:10:31 -0000	1.63
+++ EditorWindow.py	18 Jan 2005 00:54:57 -0000	1.64
@@ -744,7 +744,11 @@
         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 @@
                 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:

Index: NEWS.txt
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/NEWS.txt,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- NEWS.txt	23 Dec 2004 04:20:59 -0000	1.51
+++ NEWS.txt	18 Jan 2005 00:54:58 -0000	1.52
@@ -3,6 +3,9 @@
 
 *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 @@
 
 *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.
 
 



More information about the Python-checkins mailing list