| 226 | raise AssertionError(self._node_msg(msg)) |
| 227 | |
| 228 | def __del__(self): |
| 229 | # Ensure that we don't leave any bitcoind processes lying around after |
| 230 | # the test ends |
| 231 | if self.process: |
| 232 | # Should only happen on test failure |
| 233 | # Avoid using logger, as that may have already been shutdown when |
| 234 | # this destructor is called. |
| 235 | print(self._node_msg("Cleaning up leftover process"), file=sys.stderr) |
| 236 | self.process.kill() |
| 237 | |
| 238 | def __getattr__(self, name): |
| 239 | """Dispatches any unrecognised messages to the RPC connection or a CLI instance.""" |