patched socket to work with pypy