Kaydet (Commit) dfa74b97 authored tarafından Andrew M. Kuchling's avatar Andrew M. Kuchling

Return value from .close(); move .set_file up

üst 55430213
...@@ -509,7 +509,7 @@ if os.name == 'posix': ...@@ -509,7 +509,7 @@ if os.name == 'posix':
write = send write = send
def close(self): def close(self):
return os.close(self.fd) os.close(self.fd)
def fileno(self): def fileno(self):
return self.fd return self.fd
...@@ -519,11 +519,11 @@ if os.name == 'posix': ...@@ -519,11 +519,11 @@ if os.name == 'posix':
def __init__(self, fd, map=None): def __init__(self, fd, map=None):
dispatcher.__init__(self, None, map) dispatcher.__init__(self, None, map)
self.connected = True self.connected = True
self.set_file(fd)
# set it to non-blocking mode # set it to non-blocking mode
flags = fcntl.fcntl(fd, fcntl.F_GETFL, 0) flags = fcntl.fcntl(fd, fcntl.F_GETFL, 0)
flags = flags | os.O_NONBLOCK flags = flags | os.O_NONBLOCK
fcntl.fcntl(fd, fcntl.F_SETFL, flags) fcntl.fcntl(fd, fcntl.F_SETFL, flags)
self.set_file(fd)
def set_file(self, fd): def set_file(self, fd):
self._fileno = fd self._fileno = fd
......
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