aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/build.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2020-01-23 15:19:57 +0530
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2020-01-24 02:53:34 +0530
commitd8e738f04f9d1bf37b721ec1ff68956f7555b5ae (patch)
tree6069c91cdae2774f9cac3a73e5dd1093036ea241 /mesonbuild/build.py
parent806068304bed344a1b5cd71782c7df430084f44f (diff)
downloadmeson-d8e738f04f9d1bf37b721ec1ff68956f7555b5ae.zip
meson-d8e738f04f9d1bf37b721ec1ff68956f7555b5ae.tar.gz
meson-d8e738f04f9d1bf37b721ec1ff68956f7555b5ae.tar.bz2
typing: Fix compatibility with Python 3.5.2
Explicitly use the type instead of the string 'NotImplemented' which still works with Python 3.5.2 Fixes https://github.com/mesonbuild/meson/issues/6427
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r--mesonbuild/build.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 72b4276..0eb930b 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -355,22 +355,22 @@ a hard error in the future.''' % name)
if not hasattr(self, 'typename'):
raise RuntimeError('Target type is not set for target class "{}". This is a bug'.format(type(self).__name__))
- def __lt__(self, other: T.Any) -> T.Union[bool, 'NotImplemented']:
+ def __lt__(self, other: T.Any) -> T.Union[bool, type(NotImplemented)]:
if not hasattr(other, 'get_id') and not callable(other.get_id):
return NotImplemented
return self.get_id() < other.get_id()
- def __le__(self, other: T.Any) -> T.Union[bool, 'NotImplemented']:
+ def __le__(self, other: T.Any) -> T.Union[bool, type(NotImplemented)]:
if not hasattr(other, 'get_id') and not callable(other.get_id):
return NotImplemented
return self.get_id() <= other.get_id()
- def __gt__(self, other: T.Any) -> T.Union[bool, 'NotImplemented']:
+ def __gt__(self, other: T.Any) -> T.Union[bool, type(NotImplemented)]:
if not hasattr(other, 'get_id') and not callable(other.get_id):
return NotImplemented
return self.get_id() > other.get_id()
- def __ge__(self, other: T.Any) -> T.Union[bool, 'NotImplemented']:
+ def __ge__(self, other: T.Any) -> T.Union[bool, type(NotImplemented)]:
if not hasattr(other, 'get_id') and not callable(other.get_id):
return NotImplemented
return self.get_id() >= other.get_id()