Сокет в пайтон. Ошибка в отсутствии атрибута
import os
import socket
unix_socket_name = 'unix.sock'
s = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
if os.path.exists(unix_socket_name):
os.remove(unix_socket_name)
s.bind(unix_socket_name)
while True:
try:
result = s.recv(1024)
except KeyboardInterrupt:
s.close()
break
else:
print(f'message {result.decode("utf-8")}')
Ошибка - AttributeError: module 'socket' has no attribute 'AF_UNIX'