How to use the mirakuru.exceptions.ProcessFinishedWithError function in mirakuru

To help you get started, we’ve selected a few mirakuru examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ClearcodeHQ / mirakuru / src / mirakuru / base.py View on Github external
pass

        if self.process is None:
            # the process has already been force killed and cleaned up by the
            # `wait_for` above.
            return self
        self._kill_all_kids(sig)
        exit_code = self.process.wait()
        self._clear_process()

        # Did the process shut down cleanly? A an exit code of `-sig` means
        # that it has terminated due to signal `sig`, which is intended. So
        # don't treat that as an error.
        # pylint: disable=invalid-unary-operand-type
        if exit_code and exit_code != -sig:
            raise ProcessFinishedWithError(self, exit_code)

        return self