[Numpy-svn] r8307 - trunk/numpy/lib

numpy-svn@scip... numpy-svn@scip...
Fri Mar 26 22:56:18 CDT 2010


Author: charris
Date: 2010-03-26 22:56:17 -0500 (Fri, 26 Mar 2010)
New Revision: 8307

Modified:
   trunk/numpy/lib/utils.py
Log:
BUG: Should be using StringIO, not BytesIO. The 2to3 script takes care
of changing the module to import from to io.

Modified: trunk/numpy/lib/utils.py
===================================================================
--- trunk/numpy/lib/utils.py	2010-03-26 05:15:57 UTC (rev 8306)
+++ trunk/numpy/lib/utils.py	2010-03-27 03:56:17 UTC (rev 8307)
@@ -847,10 +847,7 @@
     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 @@
                             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



More information about the Numpy-svn mailing list