[Dextrose] [PATCH sugar-toolkit] Get rid of IPython

Anish Mangal anish at activitycentral.org
Mon Feb 14 22:01:00 EST 2011


On Fri, Feb 11, 2011 at 22:51, Aleksey Lim <alsroot at activitycentral.org> wrote:
> It is bugg on fc11, failed to print traceback due to internal import errors.
> ---
>  src/sugar/feedback.py |   23 +++--------------------
>  1 files changed, 3 insertions(+), 20 deletions(-)
>
> diff --git a/src/sugar/feedback.py b/src/sugar/feedback.py
> index 770b7a7..5833d61 100644
> --- a/src/sugar/feedback.py
> +++ b/src/sugar/feedback.py
> @@ -28,7 +28,6 @@ _SHELL_IFACE = "org.laptop.Shell"
>
>  _report = {}
>  _need_log = False
> -_log_formatter = None
>
>
>  def start(activity_id, log_path=None):
> @@ -79,29 +78,13 @@ def _send(activity_id, log_path):
>             log_path if need_log else '')
>
>
> -def _format_exception(exctype, value, tb):
> -    import traceback
> -    return ''.join(traceback.format_exception(exctype, value, tb))
> -
> -
>  def _excepthook(exctype, value, tb):
> -    global _log_formatter
> -
> -    if _log_formatter is None:
> -        try:
> -            # Attempt to provide verbose IPython tracebacks.
> -            # Importing IPython is slow, so we import it lazily.
> -            from IPython.ultraTB import AutoFormattedTB
> -            formatter = AutoFormattedTB(mode='Verbose', color_scheme='NoColor')
> -            _log_formatter = formatter.text
> -        except BaseException:
> -            _log_formatter = _format_exception
> -
>     try:
> -        message = _log_formatter(exctype, value, tb)
> +        import traceback
> +        message = ''.join(traceback.format_exception(exctype, value, tb))
>         logging.error(message)
>         trigger('unhandled_exception', need_log=True)
> -    except BaseException, error:
> +    except Exception, error:
>         print >>sys.stderr, 'Unhandled %r while processing: %r %r' % \
>                 (error, exctype, value)
>
> --
> 1.7.3.4
>
>

Committed to dextrose/mainline:
http://git.sugarlabs.org/dextrose/mainline/commit/30d275ac4dbc1e54b5ca5fc3476261de986e4e33

Reviewed-by: Anish Mangal <anish at activitycentral.org>
Acked-by: Anish Mangal <anish at activitycentral.org>


More information about the Dextrose mailing list