# Run a command and return a list of its output lines.
def run(args):
# subprocess.check_output would be ideal here, but requires Python 2.7.
# Run a command and return a list of its output lines.
def run(args):
# subprocess.check_output would be ideal here, but requires Python 2.7.
- p = Popen(args, stdout=PIPE, stderr=PIPE)
+ p = Popen(args, stdout=PIPE, stderr=PIPE, universal_newlines=True)
out, err = p.communicate()
if p.returncode != 0:
sys.stderr.write('Failed command: ' + ' '.join(args) + '\n')
out, err = p.communicate()
if p.returncode != 0:
sys.stderr.write('Failed command: ' + ' '.join(args) + '\n')
p1 = Popen(['cat', filename], stdout=PIPE)
else:
p1 = Popen(['git', 'show', rev + ':' + filename], stdout=PIPE)
p1 = Popen(['cat', filename], stdout=PIPE)
else:
p1 = Popen(['git', 'show', rev + ':' + filename], stdout=PIPE)
- p2 = Popen(['python', 'src/util/cstyle-file.py'], stdin=p1.stdout,
- stdout=PIPE)
+ p2 = Popen([sys.executable, 'src/util/cstyle-file.py'], stdin=p1.stdout,
+ stdout=PIPE, universal_newlines=True)