Ported epoll and socket to Python 3