summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-02-19 11:41:48 +0000
committerZac Medico <zmedico@gentoo.org>2009-02-19 11:41:48 +0000
commit8bac0f34818f30c68cfe409964641d79911b2512 (patch)
tree27947e11c1bf1246b2a1df09423f69c73de9b1f2
parentb032a537a6ed957c7d8797a8673b246d5fb4b603 (diff)
downloadportage-8bac0f34818f30c68cfe409964641d79911b2512.tar.gz
portage-8bac0f34818f30c68cfe409964641d79911b2512.tar.bz2
portage-8bac0f34818f30c68cfe409964641d79911b2512.zip
For python-3.0 compatibility, encode strings as binary before trying to pass
them to hashlib. svn path=/main/trunk/; revision=12645
-rw-r--r--pym/portage/dbapi/vartree.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 14c5360e2..f2d0d1a77 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -787,7 +787,7 @@ class vardbapi(dbapi):
counter, = self.aux_get(cpv, aux_keys)
except KeyError:
continue
- h.update(counter)
+ h.update(counter.encode())
return h.hexdigest()
def cpv_inject(self, mycpv):
@@ -1378,7 +1378,7 @@ class vardbapi(dbapi):
def _hash_str(self, s):
h = self._new_hash()
- h.update(s)
+ h.update(s.encode())
h = h.hexdigest()
h = h[-self._hex_chars:]
h = int(h, 16)