Fix mypy in cpp_extension.py (#69101)

Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/69101

Test Plan: Imported from OSS

Reviewed By: atalman, janeyx99

Differential Revision: D32730081

Pulled By: malfet

fbshipit-source-id: 76ace65b51850b74b175a3c4688c05e107873e8d
This commit is contained in:
Nikita Shulga
2021-11-30 15:57:53 -08:00
committed by Facebook GitHub Bot
parent 6953b7e269
commit f6f1b580f8

View File

@ -311,7 +311,7 @@ def check_compiler_abi_compatibility(compiler) -> bool:
minimum_required_version = MINIMUM_MSVC_VERSION
compiler_info = subprocess.check_output(compiler, stderr=subprocess.STDOUT)
match = re.search(r'(\d+)\.(\d+)\.(\d+)', compiler_info.decode(*SUBPROCESS_DECODE_ARGS).strip())
version = (0, 0, 0) if match is None else match.groups()
version = ['0', '0', '0'] if match is None else list(match.groups())
except Exception:
_, error, _ = sys.exc_info()
warnings.warn(f'Error checking compiler version for {compiler}: {error}')