diff options
author | Steven Knight <knight@baldmt.com> | 2010-04-07 13:16:57 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2010-04-07 13:16:57 (GMT) |
commit | 32d7c315d62846ea8febadcbb2c60cf9e3382cbf (patch) | |
tree | 4d16f888d6f0de67d3dba1341b768df17d852b44 /src/engine/SCons/Node | |
parent | d63f3f799b9e015d4a77e5874fa4cc0c4efc511f (diff) | |
download | SCons-32d7c315d62846ea8febadcbb2c60cf9e3382cbf.zip SCons-32d7c315d62846ea8febadcbb2c60cf9e3382cbf.tar.gz SCons-32d7c315d62846ea8febadcbb2c60cf9e3382cbf.tar.bz2 |
Issue 2332: Convert from using StringIO.StringIO class to using the
forward-compatible io.StringIO class, with the addition of an "io"
compatibility module for Python versions before 2.6.
Diffstat (limited to 'src/engine/SCons/Node')
-rw-r--r-- | src/engine/SCons/Node/FS.py | 3 | ||||
-rw-r--r-- | src/engine/SCons/Node/FSTests.py | 10 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index 4e455da..acba76e 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -37,7 +37,6 @@ from __future__ import generators ### KEEP FOR COMPATIBILITY FIXERS __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" from itertools import izip -import cStringIO import fnmatch import os import os.path @@ -3111,7 +3110,7 @@ class FileFinder: if verbose and not callable(verbose): if not SCons.Util.is_String(verbose): verbose = "find_file" - _verbose = ' %s: ' % verbose + _verbose = u' %s: ' % verbose verbose = lambda s: sys.stdout.write(_verbose + s) filedir, filename = os.path.split(filename) diff --git a/src/engine/SCons/Node/FSTests.py b/src/engine/SCons/Node/FSTests.py index e68b389..8e581f1 100644 --- a/src/engine/SCons/Node/FSTests.py +++ b/src/engine/SCons/Node/FSTests.py @@ -23,6 +23,8 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" +import SCons.compat + import os import os.path import sys @@ -2891,11 +2893,11 @@ class find_fileTestCase(unittest.TestCase): # 'bar/baz' as a Dir. SCons.Node.FS.find_file('baz/no_file_here', paths) - import StringIO + import io save_sys_stdout = sys.stdout try: - sio = StringIO.StringIO() + sio = io.StringIO() sys.stdout = sio SCons.Node.FS.find_file('foo2', paths, verbose="xyz") expect = " xyz: looking for 'foo2' in '.' ...\n" + \ @@ -2903,7 +2905,7 @@ class find_fileTestCase(unittest.TestCase): c = sio.getvalue() assert c == expect, c - sio = StringIO.StringIO() + sio = io.StringIO() sys.stdout = sio SCons.Node.FS.find_file('baz2', paths, verbose=1) expect = " find_file: looking for 'baz2' in '.' ...\n" + \ @@ -2912,7 +2914,7 @@ class find_fileTestCase(unittest.TestCase): c = sio.getvalue() assert c == expect, c - sio = StringIO.StringIO() + sio = io.StringIO() sys.stdout = sio SCons.Node.FS.find_file('on_disk', paths, verbose=1) expect = " find_file: looking for 'on_disk' in '.' ...\n" + \ |