Kills a previously launched executable.
(self)
| 138 | self.proc = proc |
| 139 | |
| 140 | def kill(self): |
| 141 | """ |
| 142 | Kills a previously launched executable. |
| 143 | """ |
| 144 | if self.proc is None: |
| 145 | return |
| 146 | |
| 147 | try: |
| 148 | self.proc.stdin.close() |
| 149 | self.proc.stdout.close() |
| 150 | self.proc.kill() |
| 151 | self.proc.wait() |
| 152 | self.proc = None |
| 153 | except Exception as exception: |
| 154 | raise CLIException("Could not kill {name}: {error}" |
| 155 | .format(name=self.name, error=exception)) |
| 156 | |
| 157 | |
| 158 | class Master(Executable): |
no test coverage detected