Task.__eq__: allow _hash_key as input
authorZac Medico <zmedico@gentoo.org>
Sat, 21 May 2011 08:40:30 +0000 (01:40 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 21 May 2011 08:40:30 +0000 (01:40 -0700)
This is used by depgraph._pkg() for lookups.

pym/_emerge/Task.py

index 3e1a4ba629aedabc97d0d4c5517e7375ba505296..efbe3a99d15412ae44b42f7754209b19087623f4 100644 (file)
@@ -9,7 +9,9 @@ class Task(SlotObject):
                try:
                        return self._hash_key == other._hash_key
                except AttributeError:
-                       return False
+                       # depgraph._pkg() generates _hash_key
+                       # for lookups here, so handle that
+                       return self._hash_key == other
 
        def __ne__(self, other):
                try: