Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dfa74b9

Browse files
committed
Return value from .close(); move .set_file up
1 parent 5543021 commit dfa74b9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Lib/asyncore.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ def send(self, *args):
509509
write = send
510510

511511
def close(self):
512-
return os.close(self.fd)
512+
os.close(self.fd)
513513

514514
def fileno(self):
515515
return self.fd
@@ -519,11 +519,11 @@ class file_dispatcher(dispatcher):
519519
def __init__(self, fd, map=None):
520520
dispatcher.__init__(self, None, map)
521521
self.connected = True
522+
self.set_file(fd)
522523
# set it to non-blocking mode
523524
flags = fcntl.fcntl(fd, fcntl.F_GETFL, 0)
524525
flags = flags | os.O_NONBLOCK
525526
fcntl.fcntl(fd, fcntl.F_SETFL, flags)
526-
self.set_file(fd)
527527

528528
def set_file(self, fd):
529529
self._fileno = fd

0 commit comments

Comments
 (0)