def run_command(phase, project, logger):
    command_line = project.get_property('%s_command' % phase)

    if not command_line:
        return

    process_handle = Popen(command_line, stdout=PIPE, stderr=PIPE, shell=True)
    stdout, stderr = process_handle.communicate()
    stdout, stderr = stdout.decode(sys.stdout.encoding or 'utf-8'), stderr.decode(sys.stderr.encoding or 'utf-8')
    process_return_code = process_handle.returncode

    _write_command_report(project,
                          stdout,
                          stderr,
                          command_line,
                          phase,
                          process_return_code)

    if project.get_property(phase % '%s_propagate_stdout') and stdout:
        _log_quoted_output(logger, '', stdout, phase)

    if project.get_property('%s_propagate_stderr' % phase) and stderr:
        _log_quoted_output(logger, 'error', stderr, phase)

    if process_return_code != 0:
        raise BuildFailedException(
            'exec plugin command {0} for {1} exited with nonzero code {2}'.format(command_line,
                                                                                  phase,
                                                                                  process_return_code))
dataset/ETHPy150Open pybuilder/pybuilder/src/main/python/pybuilder/plugins/exec_plugin.py/run_command/swapped operands of `%`