@contextmanager
def reraise_errors(msg=u'{0!r}', errors=None):
 assert (crypto is not None)
 errors = ((crypto.Error,) if (errors is None) else errors)
 try:
  (yield)
 except errors as exc:
  reraise(SecurityError, SecurityError(msg.format(exc)), sys.exc_info()[2])

@ contextmanager def reraise_errors ( msg = u'{0!r}' , errors = None ) : assert ( crypto is not None ) errors = ( ( crypto . Error , ) if ( errors is None ) else errors ) try : ( yield ) except errors as exc : reraise ( SecurityError , SecurityError ( msg . format ( exc ) ) , sys . exc_info ( ) [ 2 ] )
context reraising crypto errors as :exc:securityerror .