[llvm] 6475ddb - [M68k] Fix extract-section.py under Python 3

Min-Yih Hsu via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 14 11:38:59 PDT 2021


Author: Ricky Taylor
Date: 2021-03-14T11:36:57-07:00
New Revision: 6475ddb1d898a830689fd9b1c3e22dba247ba718

URL: https://github.com/llvm/llvm-project/commit/6475ddb1d898a830689fd9b1c3e22dba247ba718
DIFF: https://github.com/llvm/llvm-project/commit/6475ddb1d898a830689fd9b1c3e22dba247ba718.diff

LOG: [M68k] Fix extract-section.py under Python 3

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

Added: 
    

Modified: 
    llvm/utils/extract-section.py

Removed: 
    


################################################################################
diff  --git a/llvm/utils/extract-section.py b/llvm/utils/extract-section.py
index ab475516af95..ca19b0ee8b61 100755
--- a/llvm/utils/extract-section.py
+++ b/llvm/utils/extract-section.py
@@ -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


        


More information about the llvm-commits mailing list