diff options
author | Jonathan Slenders <jonathan@slenders.be> | 2016-07-31 15:15:43 +0200 |
---|---|---|
committer | Jonathan Slenders <jonathan@slenders.be> | 2016-07-31 15:15:43 +0200 |
commit | d8688cc5ba4ea6ff2009774fdfbaecd7f40933fe (patch) | |
tree | 2a9921a3cb2700dceabfee83400912cc56c46340 | |
parent | e872f177604620e5a531dda13451c12ae5b81e6b (diff) |
Improved comment about gevent fix.
-rw-r--r-- | prompt_toolkit/eventloop/inputhook.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/prompt_toolkit/eventloop/inputhook.py b/prompt_toolkit/eventloop/inputhook.py index 65f21088..26507d49 100644 --- a/prompt_toolkit/eventloop/inputhook.py +++ b/prompt_toolkit/eventloop/inputhook.py @@ -74,12 +74,11 @@ class InputHookContext(object): # Flush the read end of the pipe. try: - # Before calling 'os.read', call select.select. This fixes a bug - # with Gevent where the following read call blocked the select call - # from the eventloop that we call through 'input_is_ready_func' in - # the above thread. - # This appears to be only required when gevent.monkey.patch_all() - # has been executed. Otherwise it doesn't do much. + # Before calling 'os.read', call select.select. This is required + # when the gevent monkey patch has been applied. 'os.read' is never + # monkey patched and won't be cooperative, so that would block all + # other select() calls otherwise. + # See: http://www.gevent.org/gevent.os.html select_fds([self._r], timeout=None) os.read(self._r, 1024) |