From a672f6c84e318bbf455f13dfdd3fd7c68a388bf5 Mon Sep 17 00:00:00 2001 From: Xu Han Date: Mon, 5 Aug 2024 16:00:33 +0000 Subject: [PATCH] [inductor] unificate SUBPROCESS_DECODE_ARGS variable in cpp_builder.py (#132615) [inductor] unificate SUBPROCESS_DECODE_ARGS variable in cpp_builder.py Pull Request resolved: https://github.com/pytorch/pytorch/pull/132615 Approved by: https://github.com/jgong5, https://github.com/desertfire --- torch/_inductor/cpp_builder.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/torch/_inductor/cpp_builder.py b/torch/_inductor/cpp_builder.py index 523d2d5578d..d379f2b7f82 100644 --- a/torch/_inductor/cpp_builder.py +++ b/torch/_inductor/cpp_builder.py @@ -170,7 +170,7 @@ def _is_gcc(cpp_compiler: str) -> bool: def _is_msvc_cl(cpp_compiler: str) -> bool: if not _IS_WINDOWS: return False - SUBPROCESS_DECODE_ARGS = ("oem",) if _IS_WINDOWS else () + try: output_msg = ( subprocess.check_output([cpp_compiler, "/help"], stderr=subprocess.STDOUT) @@ -205,7 +205,6 @@ def is_msvc_cl() -> bool: def get_compiler_version_info(compiler: str) -> str: - SUBPROCESS_DECODE_ARGS = ("oem",) if _IS_WINDOWS else () env = os.environ.copy() env["LC_ALL"] = "C" # Don't localize output try: