From: Zac Medico Date: Tue, 12 Jul 2011 22:46:54 +0000 (-0700) Subject: Avoid baseline subprocess import under python2. X-Git-Tag: v2.2.0_alpha44~2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3e7b0cbe1ccd875de2052821d91846880c76e6e0;p=portage.git Avoid baseline subprocess import under python2. --- diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 5411ec921..2a2eb99ad 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -17,10 +17,12 @@ try: import re import types + # Try the commands module first, since this allows us to eliminate + # the subprocess module from the baseline imports under python2. try: - from subprocess import getstatusoutput as subprocess_getstatusoutput - except ImportError: from commands import getstatusoutput as subprocess_getstatusoutput + except ImportError: + from subprocess import getstatusoutput as subprocess_getstatusoutput import platform