@contextlib.contextmanager
def new_error_context(fmt_, *args, **kwargs):
 errcls = kwargs.pop('errcls_', InternalError)
 try:
  (yield)
 except NumbaError as e:
  e.add_context(_format_msg(fmt_, args, kwargs))
  raise
 except Exception as e:
  newerr = errcls(e).add_context(_format_msg(fmt_, args, kwargs))
  six.reraise(type(newerr), newerr, sys.exc_info()[2])

@ contextlib . contextmanager def new_error_context ( fmt_ , * args , ** kwargs ) : errcls = kwargs . pop ( 'errcls_' , InternalError ) try : ( yield ) except NumbaError as e : e . add_context ( _format_msg ( fmt_ , args , kwargs ) ) raise except Exception as e : newerr = errcls ( e ) . add_context ( _format_msg ( fmt_ , args , kwargs ) ) six . reraise ( type ( newerr ) , newerr , sys . exc_info ( ) [ 2 ] )
a contextmanager that prepend contextual information to any exception raised within .