Bug 1547730 - Define __hash__ for SandboxDependsFunction and CombinedDependsFunction so we can reference it as a dictionary key in py3 r=#build
☠☠ backed out by ee4b88439111 ☠ ☠
authorJustin Wood <Callek@gmail.com>
Mon, 15 Apr 2019 22:09:07 -0400
changeset 474074 61b8fcc639e087ced07e6dacf77fb66c1bb5f178
parent 474073 2d6ba80390c8d4f09a53b89936836982baebd31f
child 474075 59a1393697e0ac36ee62be71adf58a51904e02b6
push id113124
push userCallek@gmail.com
push dateThu, 16 May 2019 11:58:33 +0000
treeherdermozilla-inbound@9e9c2e06d0fb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1547730
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1547730 - Define __hash__ for SandboxDependsFunction and CombinedDependsFunction so we can reference it as a dictionary key in py3 r=#build Differential Revision: https://phabricator.services.mozilla.com/D28111
python/mozbuild/mozbuild/configure/__init__.py
--- a/python/mozbuild/mozbuild/configure/__init__.py
+++ b/python/mozbuild/mozbuild/configure/__init__.py
@@ -73,16 +73,19 @@ class SandboxDependsFunction(object):
         return self._and(other).sandboxed
 
     def __cmp__(self, other):
         raise ConfigureError('Cannot compare @depends functions.')
 
     def __eq__(self, other):
         raise ConfigureError('Cannot compare @depends functions.')
 
+    def __hash__(self):
+        return object.__hash__(self)
+
     def __ne__(self, other):
         raise ConfigureError('Cannot compare @depends functions.')
 
     def __lt__(self, other):
         raise ConfigureError('Cannot compare @depends functions.')
 
     def __le__(self, other):
         raise ConfigureError('Cannot compare @depends functions.')
@@ -227,16 +230,19 @@ class CombinedDependsFunction(DependsFun
                          for d in self.dependencies)
         return self._func(resolved_args)
 
     def __eq__(self, other):
         return (isinstance(other, self.__class__) and
                 self._func is other._func and
                 set(self.dependencies) == set(other.dependencies))
 
+    def __hash__(self):
+        return object.__hash__(self)
+
     def __ne__(self, other):
         return not self == other
 
 
 class SandboxedGlobal(dict):
     '''Identifiable dict type for use as function global'''