From: Zac Medico Date: Sun, 20 Sep 2009 22:45:32 +0000 (-0000) Subject: Add fallback in ImportError for io.StringIO. This is needed for python-2.6 X-Git-Tag: v2.2_rc42~98 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bc3bb2a0acfc132b7e0be1beec435daecbcf9e85;p=portage.git Add fallback in ImportError for io.StringIO. This is needed for python-2.6 with USE=build since io imports threading which imports thread which is unavailable. svn path=/main/trunk/; revision=14304 --- diff --git a/pym/_emerge/JobStatusDisplay.py b/pym/_emerge/JobStatusDisplay.py index 7cf3607fb..f543d00bb 100644 --- a/pym/_emerge/JobStatusDisplay.py +++ b/pym/_emerge/JobStatusDisplay.py @@ -5,7 +5,13 @@ import formatter import sys import time -from io import StringIO +try: + from io import StringIO +except ImportError: + # Needed for python-2.6 with USE=build since + # io imports threading which imports thread + # which is unavailable. + from StringIO import StringIO import portage from portage import os diff --git a/pym/portage/util.py b/pym/portage/util.py index 1401febae..a85948962 100644 --- a/pym/portage/util.py +++ b/pym/portage/util.py @@ -24,7 +24,13 @@ import shlex import stat import string import sys -from io import StringIO +try: + from io import StringIO +except ImportError: + # Needed for python-2.6 with USE=build since + # io imports threading which imports thread + # which is unavailable. + from StringIO import StringIO import portage from portage import os