From 3e7b0cbe1ccd875de2052821d91846880c76e6e0 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 12 Jul 2011 15:46:54 -0700 Subject: [PATCH] Avoid baseline subprocess import under python2. --- pym/portage/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 -- 2.26.2