gevent compatible from several PR