def ErrorMsg():
 import traceback
 type = value = tb = limit = None
 (type, value, tb) = sys.exc_info()
 list = (traceback.format_tb(tb, limit) + traceback.format_exception_only(type, value))
 return ('Traceback (innermost last):\n' + ('%-20s %s' % (string.join(list[:(-1)], ''), list[(-1)])))

def ErrorMsg ( ) : import traceback type = value = tb = limit = None ( type , value , tb ) = sys . exc_info ( ) list = ( traceback . format_tb ( tb , limit ) + traceback . format_exception_only ( type , value ) ) return ( 'Traceback (innermost last):\n' + ( '%-20s %s' % ( string . join ( list [ : ( - 1 ) ] , '' ) , list [ ( - 1 ) ] ) ) )
helper to get a nice traceback as string .