Hot fix for gevent issue 394

https://github.com/surfly/gevent/issues/394
unit test adapted for gevent issue 394

https://github.com/surfly/gevent/issues/394