From bc3bb2a0acfc132b7e0be1beec435daecbcf9e85 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 20 Sep 2009 22:45:32 +0000 Subject: [PATCH] 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 --- pym/_emerge/JobStatusDisplay.py | 8 +++++++- pym/portage/util.py | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) 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 -- 2.26.2