summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-09-20 22:45:32 +0000
committerZac Medico <zmedico@gentoo.org>2009-09-20 22:45:32 +0000
commitbc3bb2a0acfc132b7e0be1beec435daecbcf9e85 (patch)
tree5e38bd0e41ec884fe7d2b0c4cd3655304fcbbf30
parenta0093ae8eea62c089bf41ae6dc31eddb1619ad76 (diff)
downloadportage-bc3bb2a0acfc132b7e0be1beec435daecbcf9e85.tar.gz
portage-bc3bb2a0acfc132b7e0be1beec435daecbcf9e85.tar.bz2
portage-bc3bb2a0acfc132b7e0be1beec435daecbcf9e85.zip
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
-rw-r--r--pym/_emerge/JobStatusDisplay.py8
-rw-r--r--pym/portage/util.py8
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