From 148fc6a73f3fa3b53039ee3292e222015e96bc79 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 24 Aug 2011 19:48:17 -0700 Subject: python3.2 fixes: use array.tobytes() --- pym/portage/xpak.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'pym/portage/xpak.py') diff --git a/pym/portage/xpak.py b/pym/portage/xpak.py index 7487d6728..b13e257dc 100644 --- a/pym/portage/xpak.py +++ b/pym/portage/xpak.py @@ -1,4 +1,4 @@ -# Copyright 2001-2010 Gentoo Foundation +# Copyright 2001-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 @@ -66,7 +66,10 @@ def encodeint(myint): a.append((myint >> 16 ) & 0xff) a.append((myint >> 8 ) & 0xff) a.append(myint & 0xff) - return a.tostring() + try: + return a.tobytes() + except AttributeError: + return a.tostring() def decodeint(mystring): """Takes a 4 byte string and converts it into a 4 byte integer. -- cgit v1.2.3-1-g7c22