From eb17fac6fb47bd339e9c10a2af97e49da783097f Mon Sep 17 00:00:00 2001 From: Thomas Kluyver Date: Wed, 9 Dec 2015 18:31:57 +0100 Subject: [PATCH] Close PtyProcess object instead of closing fd directly --- terminado/management.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/terminado/management.py b/terminado/management.py index 8c58d5f..15b236f 100644 --- a/terminado/management.py +++ b/terminado/management.py @@ -175,10 +175,9 @@ def on_eof(self, ptywclients): self.log.info("EOF on FD %d; stopping reading", fd) del self.ptys_by_fd[fd] self.ioloop.remove_handler(fd) - os.close(fd) - - # This should reap the child process - ptywclients.ptyproc.isalive() + + # This closes the fd, and should result in the process being reaped. + ptywclients.ptyproc.close() def pty_read(self, fd, events=None): """Called by the event loop when there is pty data ready to read."""