From 09369fa9d79b549e3502ec7bb25aa1daf3a11916 Mon Sep 17 00:00:00 2001 From: Peter Goldsborough Date: Fri, 9 Nov 2018 11:43:02 -0800 Subject: [PATCH] Fix clang_tidy.py Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/13776 Differential Revision: D13002845 Pulled By: goldsborough fbshipit-source-id: 7b019a032680796cbb04f733b31749ef7c6abe54 --- tools/clang_tidy.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/clang_tidy.py b/tools/clang_tidy.py index 242b7d07adbc0..23c3902faac1d 100644 --- a/tools/clang_tidy.py +++ b/tools/clang_tidy.py @@ -45,7 +45,9 @@ def run_shell_command(arguments): try: output = subprocess.check_output(arguments).decode().strip() except subprocess.CalledProcessError: - raise RuntimeError("Error executing {}: {}".format(" ".join(arguments), output)) + _, error, _ = sys.exc_info() + error_output = error.output.decode().strip() + raise RuntimeError("Error executing {}: {}".format(" ".join(arguments), error_output)) return output