def getHandleErrorCode(self):
"""
Return the errno expected to result from writing to a closed
platform socket handle.
"""
# Windows and Python 3: returns WSAENOTSOCK
# Windows and Python 2: returns EBADF
# Linux, FreeBSD, Mac OS X: returns EBADF
if platform.isWindows() and _PY3:
return errno.WSAENOTSOCK
return errno.EBADF
评论列表
文章目录