Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 76bdf3b

Browse files
author
Åsmund Hjulstad
committed
Uses universal_newlines option for subprocess.Popen to automatically decode the output. (instead of a subsequent decode step).
1 parent b791dde commit 76bdf3b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

numpy/distutils/lib2def.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ def getnm(nm_cmd = ['nm', '-Cs', 'python%s.lib' % py_ver]):
6666
"""Returns the output of nm_cmd via a pipe.
6767
6868
nm_output = getnam(nm_cmd = 'nm -Cs py_lib')"""
69-
f = subprocess.Popen(nm_cmd, shell=True, stdout=subprocess.PIPE)
69+
f = subprocess.Popen(nm_cmd, shell=True, stdout=subprocess.PIPE, universal_newlines=True)
7070
nm_output = f.stdout.read()
7171
f.stdout.close()
72-
return nm_output.decode('ascii')
72+
return nm_output
7373

7474
def parse_nm(nm_output):
7575
"""Returns a tuple of lists: dlist for the list of data

0 commit comments

Comments
 (0)