From 134b22bf236bd6c531a59f6444d5707f166027d8 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 10 Dec 2006 19:41:18 +0000 Subject: Don't collapse the tuple into a hash, since dict can use __eq__ to avoid problems with hash collisions. Thanks to Brian Harring for reporting. svn path=/main/trunk/; revision=5262 --- pym/portage_dep.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pym/portage_dep.py b/pym/portage_dep.py index 5eacb8368..a3186e8f1 100644 --- a/pym/portage_dep.py +++ b/pym/portage_dep.py @@ -501,8 +501,8 @@ def match_from_list(mydep, candidate_list): """ global _match_from_list_cache - mylist = _match_from_list_cache.get( - hash((mydep, tuple(candidate_list))), None) + cache_key = (mydep, tuple(candidate_list)) + mylist = _match_from_list_cache.get(cache_key, None) if mylist is not None: return mylist[:] @@ -601,5 +601,5 @@ def match_from_list(mydep, candidate_list): else: raise KeyError("Unknown operator: %s" % mydep) - _match_from_list_cache[hash((mydep, tuple(candidate_list)))] = mylist + _match_from_list_cache[cache_key] = mylist return mylist -- cgit v1.2.3-1-g7c22