Returns the output of nm_cmd via a pipe. nm_output = getnm(nm_cmd = 'nm -Cs py_lib')
(nm_cmd=['nm', '-Cs', 'python%s.lib' % py_ver], shell=True)
| 60 | return libfile, deffile |
| 61 | |
| 62 | def getnm(nm_cmd=['nm', '-Cs', 'python%s.lib' % py_ver], shell=True): |
| 63 | """Returns the output of nm_cmd via a pipe. |
| 64 | |
| 65 | nm_output = getnm(nm_cmd = 'nm -Cs py_lib')""" |
| 66 | p = subprocess.Popen(nm_cmd, shell=shell, stdout=subprocess.PIPE, |
| 67 | stderr=subprocess.PIPE, text=True) |
| 68 | nm_output, nm_err = p.communicate() |
| 69 | if p.returncode != 0: |
| 70 | raise RuntimeError('failed to run "%s": "%s"' % ( |
| 71 | ' '.join(nm_cmd), nm_err)) |
| 72 | return nm_output |
| 73 | |
| 74 | def parse_nm(nm_output): |
| 75 | """Returns a tuple of lists: dlist for the list of data |