From 8bac0f34818f30c68cfe409964641d79911b2512 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 19 Feb 2009 11:41:48 +0000 Subject: For python-3.0 compatibility, encode strings as binary before trying to pass them to hashlib. svn path=/main/trunk/; revision=12645 --- pym/portage/dbapi/vartree.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pym') 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) -- cgit v1.2.3-1-g7c22