def _execute_commands_in_subprocess(commands: List[str]) -> None:
        """
        Executes the given commands in a subprocess and asserts that it was successful.
        """
        import subprocess
        with subprocess.Popen(
            commands,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            text=True,
        ) as process:
            stdout, stderr = process.communicate()
            if process.returncode != 0:
                raise Exception(f'error executing command ({process.returncode}): {stderr}')

        Executes the given commands in a subprocess and asserts that it was successful.
        
electrum/plugin.py