diff options
author | Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org> | 2009-09-20 16:22:08 +0000 |
---|---|---|
committer | Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org> | 2009-09-20 16:22:08 +0000 |
commit | 8243a08d6d2121e4c1e92201c9d4361df42e5d8f (patch) | |
tree | 8885f3b3d554054901d15c7a77bad789a8aa12e8 /pym/portage/dispatch_conf.py | |
parent | 5ce55d59b6a1e0fabd4e7879aa94f69251d03d69 (diff) | |
download | portage-8243a08d6d2121e4c1e92201c9d4361df42e5d8f.tar.gz portage-8243a08d6d2121e4c1e92201c9d4361df42e5d8f.tar.bz2 portage-8243a08d6d2121e4c1e92201c9d4361df42e5d8f.zip |
Update system imports for compatibility with Python 3.
svn path=/main/trunk/; revision=14294
Diffstat (limited to 'pym/portage/dispatch_conf.py')
-rw-r--r-- | pym/portage/dispatch_conf.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pym/portage/dispatch_conf.py b/pym/portage/dispatch_conf.py index e18eb34fa..971f9eb5f 100644 --- a/pym/portage/dispatch_conf.py +++ b/pym/portage/dispatch_conf.py @@ -7,7 +7,11 @@ # Library by Wayne Davison <gentoo@blorf.net>, derived from code # written by Jeremy Wohl (http://igmus.org) -import os, sys, commands, shutil +import os, sys, shutil +try: + from subprocess import getoutput as subprocess_getoutput +except ImportError: + from commands import getoutput as subprocess_getoutput import portage from portage.localization import _ @@ -110,7 +114,7 @@ def file_archive(archive, curconf, newconf, mrgconf): # Archive the current config file if it isn't already saved if os.path.exists(archive) \ - and len(commands.getoutput("diff -aq '%s' '%s'" % (curconf,archive))) != 0: + and len(subprocess_getoutput("diff -aq '%s' '%s'" % (curconf,archive))) != 0: suf = 1 while suf < 9 and os.path.exists(archive + '.' + str(suf)): suf += 1 |