def _explain_exception(start=(-1), stop=None, prefix='> '):
 (etype, value, tb) = sys.exc_info()
 string = traceback.format_list(traceback.extract_tb(tb)[start:stop])
 string = (''.join(string).split('\n') + traceback.format_exception_only(etype, value))
 string = ((':\n' + prefix) + ('\n' + prefix).join(string))
 return string

def _explain_exception ( start = ( - 1 ) , stop = None , prefix = '> ' ) : ( etype , value , tb ) = sys . exc_info ( ) string = traceback . format_list ( traceback . extract_tb ( tb ) [ start : stop ] ) string = ( '' . join ( string ) . split ( '\n' ) + traceback . format_exception_only ( etype , value ) ) string = ( ( ':\n' + prefix ) + ( '\n' + prefix ) . join ( string ) ) return string
explain an exception .