Skip to content

Commit

Permalink
Uses universal_newlines option for subprocess.Popen to automatically …
Browse files Browse the repository at this point in the history
…decode the output. (instead of a subsequent decode step).
  • Loading branch information
Åsmund Hjulstad committed Feb 6, 2015
1 parent b791dde commit 76bdf3b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions numpy/distutils/lib2def.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ def getnm(nm_cmd = ['nm', '-Cs', 'python%s.lib' % py_ver]):
"""Returns the output of nm_cmd via a pipe.
nm_output = getnam(nm_cmd = 'nm -Cs py_lib')"""
f = subprocess.Popen(nm_cmd, shell=True, stdout=subprocess.PIPE)
f = subprocess.Popen(nm_cmd, shell=True, stdout=subprocess.PIPE, universal_newlines=True)
nm_output = f.stdout.read()
f.stdout.close()
return nm_output.decode('ascii')
return nm_output

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

0 comments on commit 76bdf3b

Please sign in to comment.