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.
This commit is contained in:
martin f. krafft 2020-03-22 16:51:25 +13:00 committed by GitHub
parent 564930725e
commit 4b91485079
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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