]> granicus.if.org Git - python/commitdiff
Return value from .close(); move .set_file up
authorAndrew M. Kuchling <amk@amk.ca>
Sat, 10 Jul 2004 15:51:19 +0000 (15:51 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Sat, 10 Jul 2004 15:51:19 +0000 (15:51 +0000)
Lib/asyncore.py

index 8d8d88f2ec01efcc5506493b3fca98e039f5f8e8..9c36977630683f9416631a18f40fa841238e2905 100644 (file)
@@ -509,7 +509,7 @@ if os.name == 'posix':
         write = send
 
         def close(self):
-            return os.close(self.fd)
+            os.close(self.fd)
 
         def fileno(self):
             return self.fd
@@ -519,11 +519,11 @@ if os.name == 'posix':
         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