Skip to content

Commit

Permalink
[M68k] Fix extract-section.py under Python 3
Browse files Browse the repository at this point in the history
read_raw_stdin() was opening a file in binary mode, but Popen
was being told to use text mode (universal_newlines). This is
benign on Python 2 but an error on Python 3.

Differential Revision: https://reviews.llvm.org/D98428
  • Loading branch information
ricky26 authored and mshockwave committed Mar 14, 2021
1 parent 2375263 commit 6475ddb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions llvm/utils/extract-section.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ def get_raw_section_dump(readobj_path, section_name, input_file):
import subprocess
cmd = [readobj_path, '-elf-output-style=GNU', '--hex-dump={}'.format(section_name),
input_file]
proc = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
universal_newlines=True)
proc = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE)

if input_file == '-':
# From stdin
Expand Down

0 comments on commit 6475ddb

Please sign in to comment.