def get_errno(exc):
    try:
        return exc.errno
    except AttributeError:
        try:
            # e.args = (errno, reason)
            if isinstance(exc.args, tuple) and len(exc.args) == 2:
                return exc.args[0]
        except __HOLE__:
            pass
    return 0
dataset/ETHPy150Open veegee/amqpy/amqpy/utils.py/get_errno