monkey.py 文件源码

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

项目:Flask-SocketIO 作者: cutedogspark 项目源码 文件源码
def patch_ssl():
    patch_module('ssl')
    # On Python 2.5 we use an external 'ssl' module. On all
    # newer versions, the ssl module is builtin, and 'ssl.SSLError' *is*
    # 'socket.sslerror', but that's not the case with the external
    # module. Because our patched functions will raise ssl.SSLError, but
    # callers on 2.5 could only be expecting to catch 'socket.sslerror'
    # we make them the same.
    if version_info[:2] <= (2, 5):
        from gevent import ssl
        import socket
        saved['socket']['sslerror'] = socket.sslerror
        socket.sslerror = ssl.SSLError
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号