[testsuite] Remove trailing characters from command output.
authorJonas Devlieghere <jonas@devlieghere.com>
Mon, 28 Jan 2019 18:07:28 +0000 (18:07 +0000)
committerJonas Devlieghere <jonas@devlieghere.com>
Mon, 28 Jan 2019 18:07:28 +0000 (18:07 +0000)
When running the test suite on macOS with Python 3 we noticed a
difference in behavior between Python 2 and Python 3 for
seven.get_command_output. The output contained a newline with Python 3,
but not for Python 2. This resulted in an invalid SDK path passed to the
compiler.

Differential revision: https://reviews.llvm.org/D57275

llvm-svn: 352397

lldb/packages/Python/lldbsuite/support/seven.py

index e04f483..c830478 100644 (file)
@@ -15,7 +15,7 @@ else:
                 subprocess.check_output(
                     command,
                     shell=True,
-                    universal_newlines=True))
+                    universal_newlines=True).rstrip())
         except subprocess.CalledProcessError as e:
             return (e.returncode, e.output)