def errcheck(ret, func, args):
    if ret == -1:
        try:
            ec = ctypes.get_errno()
            raise U12Exception("Exodriver returned error number %s" % ec)
        except AttributeError:
            raise U12Exception("Exodriver returned an error, but LabJackPython is unable to read the error code. Upgrade to Python 2.6 for this functionality.")
    else:
        return ret
dataset/ETHPy150Open LabPy/lantz/lantz/drivers/labjack/_internal/u12.py/errcheck/original