From 8243a08d6d2121e4c1e92201c9d4361df42e5d8f Mon Sep 17 00:00:00 2001 From: Arfrever Frehtes Taifersar Arahesis Date: Sun, 20 Sep 2009 16:22:08 +0000 Subject: Update system imports for compatibility with Python 3. svn path=/main/trunk/; revision=14294 --- pym/portage/checksum.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'pym/portage/checksum.py') diff --git a/pym/portage/checksum.py b/pym/portage/checksum.py index 01637b1a6..ee2e51c71 100644 --- a/pym/portage/checksum.py +++ b/pym/portage/checksum.py @@ -12,7 +12,10 @@ from portage import _unicode_encode import errno import stat import tempfile -import commands +try: + from subprocess import getstatusoutput as subprocess_getstatusoutput +except ImportError: + from commands import getstatusoutput as subprocess_getstatusoutput #dict of all available hash functions hashfunc_map = {} @@ -112,7 +115,7 @@ hashfunc_map["size"] = getsize prelink_capable = False if os.path.exists(PRELINK_BINARY): - results = commands.getstatusoutput(PRELINK_BINARY+" --version > /dev/null 2>&1") + results = subprocess_getstatusoutput(PRELINK_BINARY+" --version > /dev/null 2>&1") if (results[0] >> 8) == 0: prelink_capable=1 del results -- cgit v1.2.3-1-g7c22