aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/envconfig.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2019-04-30 12:52:37 -0700
committerJussi Pakkanen <jpakkane@gmail.com>2019-05-02 23:38:36 +0300
commitedb1229a48a4009bde5e04c5324ef86f1e2957bb (patch)
treec7b21c4fe28ac692ae6a02d0e787e5a1c9e25a1f /mesonbuild/envconfig.py
parent1f4023fa47803458700e52352dec51f3f85fa6c1 (diff)
downloadmeson-edb1229a48a4009bde5e04c5324ef86f1e2957bb.zip
meson-edb1229a48a4009bde5e04c5324ef86f1e2957bb.tar.gz
meson-edb1229a48a4009bde5e04c5324ef86f1e2957bb.tar.bz2
mesonlib: Make a few type annotations strings
Mypy know what to do with these and isn't confused, but some versions of python 3.5 (at least 3.5.2) can't handle these annotations. By making them strings the python interpreter wont try to evaluate them. Fixes #5326
Diffstat (limited to 'mesonbuild/envconfig.py')
-rw-r--r--mesonbuild/envconfig.py6
1 files changed, 3 insertions, 3 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)