From: Zac Medico Date: Thu, 19 Feb 2009 11:41:48 +0000 (-0000) Subject: For python-3.0 compatibility, encode strings as binary before trying to pass X-Git-Tag: v2.2_rc24~161 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8bac0f34818f30c68cfe409964641d79911b2512;p=portage.git For python-3.0 compatibility, encode strings as binary before trying to pass them to hashlib. svn path=/main/trunk/; revision=12645 --- 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)