[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

PATCH: log a warning if a installclass fails to import



Log a warning when trying to load installclasses if the module can't be
loaded. In debug mode raise any errors that are found. This should maybe
just raise anything other than import errors.

Elliot

-- 
Elliot Peele
rPath, Inc.
elliot rpath com
919.851.3984 2117
diff -r 03dca8cf6f70 -r a0941259192c installclass.py
--- a/installclass.py   Mon Mar 05 18:59:17 2007 -0500
+++ b/installclass.py   Mon Mar 05 23:14:10 2007 -0500
@@ -527,7 +527,9 @@ def availableClasses(showHidden=0):
             if obj.hidden == 0 or showHidden == 1:
                 list.append(((obj.name, obj, obj.pixmap), sortOrder))
         except:
-            pass
+            log.warning ("module import of %s failed: %s" % (mainName, sys.exc_type))
+            if flags.debug: raise
+            else: continue
 
     list.sort(ordering)
     for (item, priority) in list:

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]