From 3e29cb1a49f602f4a647c18ae64f0516a76de236 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sat, 1 Jul 2017 03:38:25 +0300 Subject: [PATCH] Fix(subproc.py): Clear pid to avoid repeated killing --- subproc.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/subproc.py b/subproc.py index 502d5dd..57a9568 100755 --- a/subproc.py +++ b/subproc.py @@ -143,7 +143,9 @@ class Subprocess: except os.error as error: errno, msg = error if errno == 10: + self.pid = None raise SubprocessError("Subprocess '%s' failed." % self.cmd) + self.pid = None raise SubprocessError("Subprocess failed[%d]: %s" % (errno, msg)) if pid == self.pid: # child exited already @@ -155,6 +157,7 @@ class Subprocess: "child killed by signal %d with a return code of %d" % (sig, rc)) if rc: + self.pid = None raise SubprocessError( "child exited with return code %d" % rc) # Child may have exited, but not in error, so we won't say -- 2.39.5