summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-12-10 19:41:18 +0000
committerZac Medico <zmedico@gentoo.org>2006-12-10 19:41:18 +0000
commit134b22bf236bd6c531a59f6444d5707f166027d8 (patch)
tree687148ce25dd4cfb7f6c385ccb6a23c11319bf67
parentb2bb670b019ad5e15097578bec75ea36ff5586d6 (diff)
downloadportage-134b22bf236bd6c531a59f6444d5707f166027d8.tar.gz
portage-134b22bf236bd6c531a59f6444d5707f166027d8.tar.bz2
portage-134b22bf236bd6c531a59f6444d5707f166027d8.zip
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
-rw-r--r--pym/portage_dep.py6
1 files 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