From cfb3c55e3813cc05673a37452dea405fc0acea03 Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Sat, 27 Mar 2010 03:56:17 +0000 Subject: BUG: Should be using StringIO, not BytesIO. The 2to3 script takes care of changing the module to import from to io. --- numpy/lib/utils.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'numpy/lib/utils.py') 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 -- cgit v1.2.1