[llvm-branch-commits] [cfe-branch] r151770 - /cfe/branches/Apple/palisade-IB/order-files/gen-order-file

Daniel Dunbar daniel at zuster.org
Wed Feb 29 15:35:38 PST 2012


Author: ddunbar
Date: Wed Feb 29 17:35:38 2012
New Revision: 151770

URL: http://llvm.org/viewvc/llvm-project?rev=151770&view=rev
Log:
build/order-files: Define our own check_output so we don't require Python 2.7.

Modified:
    cfe/branches/Apple/palisade-IB/order-files/gen-order-file

Modified: cfe/branches/Apple/palisade-IB/order-files/gen-order-file
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/palisade-IB/order-files/gen-order-file?rev=151770&r1=151769&r2=151770&view=diff
==============================================================================
--- cfe/branches/Apple/palisade-IB/order-files/gen-order-file (original)
+++ cfe/branches/Apple/palisade-IB/order-files/gen-order-file Wed Feb 29 17:35:38 2012
@@ -10,6 +10,13 @@
 
 import commands
 
+def check_output(*popen_args, **popen_kwargs):
+    p = subprocess.Popen(stdout=subprocess.PIPE, *popen_args, **popen_kwargs)
+    stdout,stderr = p.communicate()
+    if p.wait() != 0:
+        raise RuntimeError("process failed")
+    return stdout
+
 def uniq(list):
     seen = set()
     for item in list:
@@ -188,7 +195,7 @@
     # If the user gave us a binary, get all the symbols in the binary by
     # snarfing 'nm' output.
     if opts.binary_path is not None:
-       output = subprocess.check_output(['nm', '-P', opts.binary_path])
+       output = check_output(['nm', '-P', opts.binary_path])
        lines = output.split("\n")
        all_symbols = [ln.split(' ',1)[0]
                       for ln in lines





More information about the llvm-branch-commits mailing list