From 1a103470a13a83590b3fc06e8779494e2b99751d Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Mon, 1 May 2023 11:54:48 -0600 Subject: Add some cheap return and parameter annotations Use: https://github.com/JelleZijlstra/autotyping to add "safe" return annotations. Where a parameter has a default value that is an obvious scalar type (bool, int, str, etc.) add those annotations as well. Also fixed two small bugs that popped up when sanity-checking with mypy. One in FortranCommon, where a return had been previously annotated to be a tuple of Action, which should be ActionBase - Action is the factory function, not the base class. The other was a typo in the error raised in _add_cppdefines - the message was formatted with the value of "define" which should have been "defines". Signed-off-by: Mats Wichmann --- SCons/Tool/cyglink.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'SCons/Tool/cyglink.py') diff --git a/SCons/Tool/cyglink.py b/SCons/Tool/cyglink.py index bb5cd1035..0d1eb51a4 100644 --- a/SCons/Tool/cyglink.py +++ b/SCons/Tool/cyglink.py @@ -134,7 +134,7 @@ def cyglink_ldmodule_version(target, source, env, for_signature): return "." + version -def _implib_pre_flags(target, source, env, for_signature): +def _implib_pre_flags(target, source, env, for_signature) -> str: no_import_lib = env.get('no_import_lib', False) if no_import_lib in ['1', 'True', 'true', True]: return '' @@ -142,7 +142,7 @@ def _implib_pre_flags(target, source, env, for_signature): return '-Wl,--out-implib=${TARGETS[1]} -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive' -def _implib_post_flags(target, source, env, for_signature): +def _implib_post_flags(target, source, env, for_signature) -> str: no_import_lib = env.get('no_import_lib', False) if no_import_lib in ['1', 'True', 'true', True]: return '' @@ -150,7 +150,7 @@ def _implib_post_flags(target, source, env, for_signature): return '-Wl,--no-whole-archive' -def generate(env): +def generate(env) -> None: """Add Builders and construction variables for cyglink to an Environment.""" gnulink.generate(env) -- cgit v1.2.1