summaryrefslogtreecommitdiff
path: root/numpy/lib/utils.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2010-03-27 03:56:17 +0000
committerCharles Harris <charlesr.harris@gmail.com>2010-03-27 03:56:17 +0000
commitcfb3c55e3813cc05673a37452dea405fc0acea03 (patch)
tree035d5528f1425e56cdc878b11ea95b842da8668f /numpy/lib/utils.py
parentb64659e01eeeaf1d4498f2140911499c05702c70 (diff)
downloadnumpy-cfb3c55e3813cc05673a37452dea405fc0acea03.tar.gz
BUG: Should be using StringIO, not BytesIO. The 2to3 script takes care
of changing the module to import from to io.
Diffstat (limited to 'numpy/lib/utils.py')
-rw-r--r--numpy/lib/utils.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py
index a8ad79772..d9e37a65b 100644
--- a/numpy/lib/utils.py
+++ b/numpy/lib/utils.py
@@ -847,10 +847,7 @@ def _lookfor_generate_cache(module, import_modules, regenerate):
global _lookfor_caches
# Local import to speed up numpy's import time.
import inspect
- if sys.version_info[0] >= 3:
- from io import BytesIO
- else:
- from cStringIO import StringIO as BytesIO
+ from cStringIO import StringIO
if module is None:
module = "numpy"
@@ -918,8 +915,8 @@ def _lookfor_generate_cache(module, import_modules, regenerate):
old_stdout = sys.stdout
old_stderr = sys.stderr
try:
- sys.stdout = BytesIO()
- sys.stderr = BytesIO()
+ sys.stdout = StringIO()
+ sys.stderr = StringIO()
__import__("%s.%s" % (name, to_import))
finally:
sys.stdout = old_stdout