summaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2010-08-27 19:23:59 (GMT)
committerSteven Knight <knight@baldmt.com>2010-08-27 19:23:59 (GMT)
commit017f807a0745357b4b9b16c52738ef5949f84b90 (patch)
treef8592e5ada48a821e83ad3df2a38e28baa4c2c88 /src/engine
parent06a72d788b7695cfc6a6e53e9d3808a12d929b9d (diff)
downloadSCons-017f807a0745357b4b9b16c52738ef5949f84b90.zip
SCons-017f807a0745357b4b9b16c52738ef5949f84b90.tar.gz
SCons-017f807a0745357b4b9b16c52738ef5949f84b90.tar.bz2
Python 2.7 fixes in four tests.
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/SCons/SubstTests.py4
-rw-r--r--src/engine/SCons/UtilTests.py9
2 files changed, 10 insertions, 3 deletions
diff --git a/src/engine/SCons/SubstTests.py b/src/engine/SCons/SubstTests.py
index e1cd833..4568528 100644
--- a/src/engine/SCons/SubstTests.py
+++ b/src/engine/SCons/SubstTests.py
@@ -550,8 +550,10 @@ class scons_subst_TestCase(SubstTestCase):
expect = [
# Python 2.3, 2.4
"TypeError `unsubscriptable object' trying to evaluate `${NONE[2]}'",
- # Python 2.5 and later
+ # Python 2.5, 2.6
"TypeError `'NoneType' object is unsubscriptable' trying to evaluate `${NONE[2]}'",
+ # Python 2.7 and later
+ "TypeError `'NoneType' object is not subscriptable' trying to evaluate `${NONE[2]}'",
]
assert str(e) in expect, e
else:
diff --git a/src/engine/SCons/UtilTests.py b/src/engine/SCons/UtilTests.py
index 3f65456..a1e6756 100644
--- a/src/engine/SCons/UtilTests.py
+++ b/src/engine/SCons/UtilTests.py
@@ -668,7 +668,7 @@ class UtilTestCase(unittest.TestCase):
def test_LogicalLines(self):
"""Test the LogicalLines class"""
- fobj = io.StringIO(r"""
+ content = r"""
foo \
bar \
baz
@@ -676,7 +676,12 @@ foo
bling \
bling \ bling
bling
-""")
+"""
+ try:
+ fobj = io.StringIO(content)
+ except TypeError:
+ # Python 2.7 and beyond require unicode strings.
+ fobj = io.StringIO(unicode(content))
lines = LogicalLines(fobj).readlines()
assert lines == [