def _exec_template(callable_, context, args=None, kwargs=None):
 template = context._with_template
 if ((template is not None) and (template.format_exceptions or template.error_handler)):
  error = None
  try:
   callable_(context, *args, **kwargs)
  except Exception as e:
   _render_error(template, context, e)
  except:
   e = sys.exc_info()[0]
   _render_error(template, context, e)
 else:
  callable_(context, *args, **kwargs)

def _exec_template ( callable_ , context , args = None , kwargs = None ) : template = context . _with_template if ( ( template is not None ) and ( template . format_exceptions or template . error_handler ) ) : error = None try : callable_ ( context , * args , ** kwargs ) except Exception as e : _render_error ( template , context , e ) except : e = sys . exc_info ( ) [ 0 ] _render_error ( template , context , e ) else : callable_ ( context , * args , ** kwargs )
execute a rendering callable given the callable .