From b9d47b38ce81d545fe5ccf10bf21be98f54eb3a6 Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Tue, 28 May 2019 14:28:30 +0000 Subject: [PATCH] Bug 1547730 - Define __hash__ for SandboxDependsFunction and CombinedDependsFunction so we can reference it as a dictionary key in py3 r=glandium Differential Revision: https://phabricator.services.mozilla.com/D28111 --HG-- extra : moz-landing-system : lando --- python/mozbuild/mozbuild/configure/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python/mozbuild/mozbuild/configure/__init__.py b/python/mozbuild/mozbuild/configure/__init__.py index 6288c99faf4f..02e3ad0e6624 100644 --- a/python/mozbuild/mozbuild/configure/__init__.py +++ b/python/mozbuild/mozbuild/configure/__init__.py @@ -78,6 +78,9 @@ class SandboxDependsFunction(object): 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.') @@ -232,6 +235,9 @@ class CombinedDependsFunction(DependsFunction): 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