Commit 0c3d787e authored by Denis Bilenko's avatar Denis Bilenko

fileobject: do not lose other flags when setting O_NONBLOCK flag

parent ad5dd7b9
......@@ -26,6 +26,7 @@ else:
from gevent.socket import _fileobject, _get_memory
cancel_wait_ex = IOError(EBADF, 'File descriptor was closed in another greenlet')
from gevent.os import make_nonblocking
try:
from gevent._util import SocketAdapter__del__, noop
......@@ -56,7 +57,7 @@ else:
self._mode = mode or 'rb'
self._close = close
self._translate = 'U' in self._mode
fcntl(fileno, F_SETFL, os.O_NONBLOCK)
make_nonblocking(fileno)
self._eat_newline = False
self.hub = get_hub()
io = self.hub.loop.io
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment