[Dextrose] [PATCH] Having only one sys.excepthook handler in sugar

Aleksey Lim alsroot at activitycentral.org
Fri Feb 11 21:29:47 EST 2011


sys.excepthook will be set in sugar.feedback modules to handle exception
for feedback reports.
---
 src/sugar/logger.py |   16 ----------------
 1 files changed, 0 insertions(+), 16 deletions(-)

diff --git a/src/sugar/logger.py b/src/sugar/logger.py
index 275c57d..ae2caa2 100644
--- a/src/sugar/logger.py
+++ b/src/sugar/logger.py
@@ -64,20 +64,6 @@ def set_level(level):
         logging.warning('Invalid log level: %r', level)
 
 
-# pylint: disable-msg=E1101,F0401
-def _except_hook(exctype, value, traceback):
-    # Attempt to provide verbose IPython tracebacks.
-    # Importing IPython is slow, so we import it lazily.
-    try:
-        from IPython.ultraTB import AutoFormattedTB
-        sys.excepthook = AutoFormattedTB(mode='Verbose',
-            color_scheme='NoColor')
-    except ImportError:
-        sys.excepthook = sys.__excepthook__
-
-    sys.excepthook(exctype, value, traceback)
-
-
 def start(log_filename=None):
     # remove existing handlers, or logging.basicConfig() won't have no effect.
     root_logger = logging.getLogger('')
@@ -130,8 +116,6 @@ def start(log_filename=None):
             if e.errno != errno.ENOSPC:
                 raise e
 
-    sys.excepthook = _except_hook
-
 
 class TraceRepr(repr_.Repr):
 
-- 
1.7.3.4



More information about the Dextrose mailing list