Setting TCP_NODELAY may fail. Instead of failing the routine, log it and continue. It seems, that setting TCP_NODELAY in python on Mac OS X is not necessarily supported.