(function)
return result
Wrap any raised struct.errors in a ConversionError.
Wrap any raised struct.errors in a ConversionError.
Wrap any raised struct . errors in a ConversionError .
def raise_conversion_error(function):
    """ Wrap any raised struct.errors in a ConversionError. """

    @wraps(function)
    def result(self, value):
        try:
            return function(self, value)
        except struct.error as e:
            raise ConversionError(e.args[0]) from None
    return result
def raise_conversion_error ( function ) : @ wraps ( function ) def result ( self , value ) : try : return function ( self , value ) except struct . error as e : raise ConversionError ( e . args [ 0 ] ) from None return result