def formatSocketType(argument):
value = argument.value
text = []
if hasattr(socket, 'SOCK_CLOEXEC'):
cloexec = value & socket.SOCK_CLOEXEC
value &= ~socket.SOCK_CLOEXEC
else:
cloexec = False
text = SOCKET_TYPE.get(value, str(value))
if cloexec:
text += '|SOCK_CLOEXEC'
return text
评论列表
文章目录