libusb0.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:ipwndfu 作者: axi0mX 项目源码 文件源码
def _check(ret):
    if ret is None:
        errmsg = _lib.usb_strerror()
    else:
        if hasattr(ret, 'value'):
            ret = ret.value

        if ret < 0:
            errmsg = _lib.usb_strerror()
            # No error means that we need to get the error
            # message from the return code
            # Thanks to Nicholas Wheeler to point out the problem...
            # Also see issue #2860940
            if errmsg.lower() == 'no error':
                errmsg = os.strerror(-ret)
        else:
            return ret
    raise USBError(errmsg, ret)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号