summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>2009-09-20 16:22:08 +0000
committerArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>2009-09-20 16:22:08 +0000
commit8243a08d6d2121e4c1e92201c9d4361df42e5d8f (patch)
tree8885f3b3d554054901d15c7a77bad789a8aa12e8 /pym/repoman
parentUpdate syntax of numbers in some files which were missing in previous commit. (diff)
downloadportage-multirepo-8243a08d6d2121e4c1e92201c9d4361df42e5d8f.tar.gz
portage-multirepo-8243a08d6d2121e4c1e92201c9d4361df42e5d8f.tar.bz2
portage-multirepo-8243a08d6d2121e4c1e92201c9d4361df42e5d8f.zip
Update system imports for compatibility with Python 3.
svn path=/main/trunk/; revision=14294
Diffstat (limited to 'pym/repoman')
-rw-r--r--pym/repoman/utilities.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py
index a65e57d5..fcabd599 100644
--- a/pym/repoman/utilities.py
+++ b/pym/repoman/utilities.py
@@ -19,11 +19,14 @@ __all__ = [
]
import codecs
-import commands
import errno
import itertools
import logging
import sys
+try:
+ from subprocess import getstatusoutput as subprocess_getstatusoutput
+except ImportError:
+ from commands import getstatusoutput as subprocess_getstatusoutput
from xml.dom import minidom
from xml.dom import NotFoundErr
@@ -59,13 +62,13 @@ def detect_vcs_conflicts(options, vcs):
if vcs == 'cvs':
logging.info("Performing a " + output.green("cvs -n up") + \
" with a little magic grep to check for updates.")
- retval = commands.getstatusoutput("cvs -n up 2>&1 | " + \
+ retval = subprocess_getstatusoutput("cvs -n up 2>&1 | " + \
"egrep '^[^\?] .*' | " + \
"egrep -v '^. .*/digest-[^/]+|^cvs server: .* -- ignored$'")
if vcs == 'svn':
logging.info("Performing a " + output.green("svn status -u") + \
" with a little magic grep to check for updates.")
- retval = commands.getstatusoutput("svn status -u 2>&1 | " + \
+ retval = subprocess_getstatusoutput("svn status -u 2>&1 | " + \
"egrep -v '^. +.*/digest-[^/]+' | " + \
"head -n-1")