diff options
-rw-r--r-- | mesonbuild/envconfig.py | 6 | ||||
-rw-r--r-- | mesonbuild/mesonlib.py | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py index 977d930..f29fbba 100644 --- a/mesonbuild/envconfig.py +++ b/mesonbuild/envconfig.py @@ -134,7 +134,7 @@ class Properties(HasEnvVarFallback): def get_sys_root(self) -> typing.Optional[typing.Union[str, typing.List[str]]]: return self.properties.get('sys_root', None) - def __eq__(self, other: typing.Any) -> typing.Union[bool, 'NotImplemented']: + def __eq__(self, other: typing.Any) -> 'typing.Union[bool, NotImplemented]': if isinstance(other, type(self)): return self.properties == other.properties return NotImplemented @@ -159,7 +159,7 @@ class MachineInfo: self.endian = endian self.is_64_bit = cpu_family in CPU_FAMILES_64_BIT # type: bool - def __eq__(self, other: typing.Any) -> typing.Union[bool, 'NotImplemented']: + def __eq__(self, other: typing.Any) -> 'typing.Union[bool, NotImplemented]': if self.__class__ is not other.__class__: return NotImplemented return \ @@ -168,7 +168,7 @@ class MachineInfo: self.cpu == other.cpu and \ self.endian == other.endian - def __ne__(self, other: typing.Any) -> typing.Union[bool, 'NotImplemented']: + def __ne__(self, other: typing.Any) -> 'typing.Union[bool, NotImplemented]': if self.__class__ is not other.__class__: return NotImplemented return not self.__eq__(other) diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py index aaaf144..f78fa35 100644 --- a/mesonbuild/mesonlib.py +++ b/mesonbuild/mesonlib.py @@ -920,7 +920,8 @@ def extract_as_list(dict_object, *keys, pop=False, **kwargs): result.append(listify(fetch(key, []), **kwargs)) return result -def typeslistify(item: typing.Union[_T, typing.List[_T]], types: typing.Union[typing.Type[_T], typing.Tuple[typing.Type[_T]]]) -> typing.List[_T]: +def typeslistify(item: 'typing.Union[_T, typing.List[_T]]', + types: 'typing.Union[typing.Type[_T], typing.Tuple[typing.Type[_T]]]') -> typing.List[_T]: ''' Ensure that type(@item) is one of @types or a list of items all of which are of type @types |