shell_command: reset internal proc state in "run_with_response"

This sets a clean state should a shell command be run more than once.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Arksine 2021-03-03 07:52:57 -05:00
parent cea9af1ef8
commit 22a5f6720c
1 changed files with 2 additions and 0 deletions

View File

@ -107,6 +107,8 @@ class ShellCommand:
return self._check_proc_success(complete) return self._check_proc_success(complete)
async def run_with_response(self, timeout=2., retries=1): async def run_with_response(self, timeout=2., retries=1):
self.return_code = self.proc = None
self.cancelled = False
while retries > 0: while retries > 0:
stdout = stderr = None stdout = stderr = None
if await self._create_subprocess(): if await self._create_subprocess():