[Lldb-commits] [PATCH] D14162: Create Python library `seven` in lldbsuite.support

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 28 22:50:32 PDT 2015


zturner added inline comments.

================
Comment at: packages/Python/lldbsuite/support/seven.py:12
@@ +11,3 @@
+            import subprocess
+            return (0, subprocess.check_output(command, shell=True))
+        except subprocess.CalledProcessError as e:
----------------
tfiala wrote:
> Is it correct to assume a 0 return code here?  Couldn't we have output and have a non-zero status return that ins't a call exception?
The documentation of `check_output` says this:

    Run command with arguments and return its output as a byte string.

    If the return code was non-zero it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute and any output in the output attribute.

So I think it's correct.  Might not hurt to have a comment to that effect though


http://reviews.llvm.org/D14162





More information about the lldb-commits mailing list