exec() the tunnel command

There is no reason that the shell invoking the tunnel command needs to stay
around. Using `exec` to replace the parent with the tunnel command works just
fine and results in a cleaner process table.

Sent-by: martin f. krafft <madduck@madduck.net>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
martin f. krafft 2020-03-22 16:51:25 +13:00 committed by Nicolas Sebrecht
parent 84efb45270
commit 4562b1c5d1
1 changed files with 1 additions and 1 deletions

View File

@ -132,7 +132,7 @@ class IMAP4_Tunnel(UsefulIMAPMixIn, IMAP4):
"""The tunnelcmd comes in on host!"""
self.host = host
self.process = subprocess.Popen(host, shell=True, close_fds=True,
self.process = subprocess.Popen('exec %s'%host, shell=True, close_fds=True,
stdin=subprocess.PIPE, stdout=subprocess.PIPE)
(self.outfd, self.infd) = (self.process.stdin, self.process.stdout)
# imaplib2 polls on this fd