[Python-checkins] python/dist/src/Lib/idlelib EditorWindow.py, 1.53.6.1, 1.53.6.2 NEWS.txt, 1.23.4.10, 1.23.4.11

kbk at users.sourceforge.net kbk at users.sourceforge.net
Mon Jan 17 21:35:07 CET 2005


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

Modified Files:
      Tag: release23-maint
	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.53.6.1
retrieving revision 1.53.6.2
diff -u -d -r1.53.6.1 -r1.53.6.2
--- EditorWindow.py	22 Sep 2003 14:56:11 -0000	1.53.6.1
+++ EditorWindow.py	17 Jan 2005 20:34:45 -0000	1.53.6.2
@@ -770,7 +770,11 @@
         return idleConf.GetExtensions()
 
     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)
         ins = cls(self)
         self.extensions[name] = ins

Index: NEWS.txt
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/NEWS.txt,v
retrieving revision 1.23.4.10
retrieving revision 1.23.4.11
diff -u -d -r1.23.4.10 -r1.23.4.11
--- NEWS.txt	17 Jan 2005 20:06:47 -0000	1.23.4.10
+++ NEWS.txt	17 Jan 2005 20:34:49 -0000	1.23.4.11
@@ -3,6 +3,9 @@
 
 *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
   backport of configHandler.py, Revision 1.36,  11Jan05.
 



More information about the Python-checkins mailing list