summaryrefslogtreecommitdiff
path: root/SCons/EnvironmentValues.py
diff options
context:
space:
mode:
authorMats Wichmann <mats@linux.com>2023-05-01 11:54:48 -0600
committerMats Wichmann <mats@linux.com>2023-05-01 12:06:45 -0600
commit1a103470a13a83590b3fc06e8779494e2b99751d (patch)
treeab4b5fcdbc2504ff1436387dbe82db2dcedff22b /SCons/EnvironmentValues.py
parent0ef81fc03600cd275a8e6733aeca26e0db268dad (diff)
downloadscons-git-1a103470a13a83590b3fc06e8779494e2b99751d.tar.gz
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 <mats@linux.com>
Diffstat (limited to 'SCons/EnvironmentValues.py')
-rw-r--r--SCons/EnvironmentValues.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/SCons/EnvironmentValues.py b/SCons/EnvironmentValues.py
index c5eb972c2..51368c915 100644
--- a/SCons/EnvironmentValues.py
+++ b/SCons/EnvironmentValues.py
@@ -72,7 +72,7 @@ class EnvironmentValue:
Hold a single value. We're going to cache parsed version of the file
We're going to keep track of variables which feed into this values evaluation
"""
- def __init__(self, value):
+ def __init__(self, value) -> None:
self.value = value
self.var_type = ValueTypes.UNKNOWN
@@ -82,7 +82,7 @@ class EnvironmentValue:
self.parse_value()
- def parse_value(self):
+ def parse_value(self) -> None:
"""
Scan the string and break into component values
"""
@@ -99,7 +99,7 @@ class EnvironmentValue:
# likely callable? either way we don't parse
self._parsed = self.value
- def parse_trial(self):
+ def parse_trial(self) -> None:
"""
Try alternate parsing methods.
:return:
@@ -113,7 +113,7 @@ class EnvironmentValues:
"""
A class to hold all the environment variables
"""
- def __init__(self, **kw):
+ def __init__(self, **kw) -> None:
self._dict = {}
for k in kw:
self._dict[k] = EnvironmentValue(kw[k])