diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-09-27 14:13:30 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-09-27 14:13:30 -0700 |
commit | 59f50a0bf9bdbb3aab4eee097e12bf32eeb12274 (patch) | |
tree | 612cd24ce13d19154f7e45bc2efa07f971bc86f8 | |
parent | ebbdaf4d7f46f3a1cc11ae34ae642e8b9a62c18f (diff) | |
download | portage-59f50a0bf9bdbb3aab4eee097e12bf32eeb12274.tar.gz portage-59f50a0bf9bdbb3aab4eee097e12bf32eeb12274.tar.bz2 portage-59f50a0bf9bdbb3aab4eee097e12bf32eeb12274.zip |
Fix Task.__eq__() and __ne__() to explicitly compare the results
from _get_hash_key().
-rw-r--r-- | pym/_emerge/Task.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pym/_emerge/Task.py b/pym/_emerge/Task.py index 31788b576..dfb560f6a 100644 --- a/pym/_emerge/Task.py +++ b/pym/_emerge/Task.py @@ -12,10 +12,14 @@ class Task(SlotObject): raise NotImplementedError(self) def __eq__(self, other): - return self._get_hash_key() == other + if self.__class__ is not other.__class__: + return False + return self._get_hash_key() == other._get_hash_key() def __ne__(self, other): - return self._get_hash_key() != other + if self.__class__ is not other.__class__: + return True + return self._get_hash_key() != other._get_hash_key() def __hash__(self): hash_value = getattr(self, "_hash_value", None) |