mirror of https://github.com/python/cpython.git
Return value from .close(); move .set_file up
This commit is contained in:
parent
55430213c5
commit
dfa74b97ec
|
@ -509,7 +509,7 @@ def send(self, *args):
|
|||
write = send
|
||||
|
||||
def close(self):
|
||||
return os.close(self.fd)
|
||||
os.close(self.fd)
|
||||
|
||||
def fileno(self):
|
||||
return self.fd
|
||||
|
@ -519,11 +519,11 @@ class file_dispatcher(dispatcher):
|
|||
def __init__(self, fd, map=None):
|
||||
dispatcher.__init__(self, None, map)
|
||||
self.connected = True
|
||||
self.set_file(fd)
|
||||
# set it to non-blocking mode
|
||||
flags = fcntl.fcntl(fd, fcntl.F_GETFL, 0)
|
||||
flags = flags | os.O_NONBLOCK
|
||||
fcntl.fcntl(fd, fcntl.F_SETFL, flags)
|
||||
self.set_file(fd)
|
||||
|
||||
def set_file(self, fd):
|
||||
self._fileno = fd
|
||||
|
|
Loading…
Reference in New Issue