diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2021-08-30 10:27:53 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2021-08-30 10:27:53 -0700 |
commit | 42eadd18d6390a6e2a070fe3391dfcd0325d1395 (patch) | |
tree | c99907edfb5ffee1b9504bc9ff577d6eef6c8d08 /mesonbuild/environment.py | |
parent | 41c96d50af65ffd3946a7120ef335d7204557596 (diff) | |
download | meson-42eadd18d6390a6e2a070fe3391dfcd0325d1395.zip meson-42eadd18d6390a6e2a070fe3391dfcd0325d1395.tar.gz meson-42eadd18d6390a6e2a070fe3391dfcd0325d1395.tar.bz2 |
environment: Add a few type annotations
These are just annotations in code that I'm working for this series
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r-- | mesonbuild/environment.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index 4b3b6db..5a9a587 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -359,7 +359,7 @@ def detect_cpu_family(compilers: CompilersDict) -> str: return trial -def detect_cpu(compilers: CompilersDict): +def detect_cpu(compilers: CompilersDict) -> str: if mesonlib.is_windows(): trial = detect_windows_arch(compilers) elif mesonlib.is_freebsd() or mesonlib.is_netbsd() or mesonlib.is_openbsd() or mesonlib.is_aix(): @@ -392,15 +392,13 @@ def detect_cpu(compilers: CompilersDict): # detect_cpu_family() above. return trial -def detect_system(): +def detect_system() -> str: if sys.platform == 'cygwin': return 'cygwin' return platform.system().lower() -def detect_msys2_arch(): - if 'MSYSTEM_CARCH' in os.environ: - return os.environ['MSYSTEM_CARCH'] - return None +def detect_msys2_arch() -> T.Optional[str]: + return os.environ.get('MSYSTEM_CARCH', None) def detect_machine_info(compilers: T.Optional[CompilersDict] = None) -> MachineInfo: """Detect the machine we're running on |