Python struct.errors() Examples

The following are code examples for showing how to use struct.errors(). They are from open source Python projects. You can vote up the examples you like or vote down the ones you don't like.

Example 1
Project: pyblish-win   Author: pyblish   File: xdrlib.py    GNU Lesser General Public License v3.0 5 votes vote down vote up
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])
    return result 
Example 2
Project: NiujiaoDebugger   Author: MrSrc   File: xdrlib.py    GNU General Public License v3.0 5 votes vote down vote up
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 
Example 3
Project: ironpython2   Author: IronLanguages   File: xdrlib.py    Apache License 2.0 5 votes vote down vote up
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])
    return result 
Example 4
Project: Blockly-rduino-communication   Author: technologiescollege   File: xdrlib.py    GNU General Public License v3.0 5 votes vote down vote up
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 
Example 5
Project: cqp-sdk-for-py37-native   Author: crud-boy   File: xdrlib.py    GNU General Public License v2.0 5 votes vote down vote up
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 
Example 6
Project: aws-lambda-runtime-pypy   Author: uscheller   File: xdrlib.py    Apache License 2.0 5 votes vote down vote up
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 
Example 7
Project: oss-ftp   Author: aliyun   File: xdrlib.py    MIT License 5 votes vote down vote up
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])
    return result 
Example 8
Project: setup   Author: mindbender-studio   File: xdrlib.py    MIT License 5 votes vote down vote up
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 
Example 9
Project: godot-zeronet-plugin   Author: zam-org   File: xdrlib.py    GNU General Public License v2.0 5 votes vote down vote up
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])
    return result 
Example 10
Project: godot-zeronet-plugin   Author: zam-org   File: xdrlib.py    GNU General Public License v2.0 5 votes vote down vote up
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])
    return result 
Example 11
Project: godot-zeronet-plugin   Author: zam-org   File: xdrlib.py    GNU General Public License v2.0 5 votes vote down vote up
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])
    return result 
Example 12
Project: godot-zeronet-plugin   Author: zam-org   File: xdrlib.py    GNU General Public License v2.0 5 votes vote down vote up
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])
    return result 
Example 13
Project: godot-zeronet-plugin   Author: zam-org   File: xdrlib.py    GNU General Public License v2.0 5 votes vote down vote up
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])
    return result 
Example 14
Project: KalutClient   Author: TwoUnderscorez   File: xdrlib.py    Apache License 2.0 5 votes vote down vote up
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])
    return result 
Example 15
Project: Wallet   Author: superbitcoin   File: xdrlib.py    MIT License 5 votes vote down vote up
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])
    return result 
Example 16
Project: linux-cross-gcc   Author: nmercier   File: xdrlib.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
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])
    return result 
Example 17
Project: linux-cross-gcc   Author: nmercier   File: xdrlib.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
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])
    return result 
Example 18
Project: docker   Author: getavalon   File: xdrlib.py    MIT License 5 votes vote down vote up
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 
Example 19
Project: Splunking-Crime   Author: nccgroup   File: xdrlib.py    GNU Affero General Public License v3.0 5 votes vote down vote up
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])
    return result 
Example 20
Project: Project-New-Reign---Nemesis-Main   Author: ShikyoKira   File: xdrlib.py    GNU General Public License v3.0 5 votes vote down vote up
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 
Example 21
Project: cells   Author: AlesTsurko   File: xdrlib.py    MIT License 5 votes vote down vote up
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