summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2017-02-28 20:08:24 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2017-02-28 20:08:24 (GMT)
commite3b86af463e2a9eef98cd7c74469a5fff96f19c9 (patch)
tree80318379575906bfb62fa15b5501a15c3672d496
parent9dc001124dc72907556139a3b1f61148d1e539cf (diff)
downloadSCons-e3b86af463e2a9eef98cd7c74469a5fff96f19c9.zip
SCons-e3b86af463e2a9eef98cd7c74469a5fff96f19c9.tar.gz
SCons-e3b86af463e2a9eef98cd7c74469a5fff96f19c9.tar.bz2
py2/3 fixes
-rw-r--r--QMTest/TestSCons_time.py7
-rw-r--r--test/scons-time/run/config/scons.py3
-rw-r--r--test/scons-time/run/option/scons.py2
3 files changed, 7 insertions, 5 deletions
diff --git a/QMTest/TestSCons_time.py b/QMTest/TestSCons_time.py
index ba7fbd8..6778d1b 100644
--- a/QMTest/TestSCons_time.py
+++ b/QMTest/TestSCons_time.py
@@ -28,8 +28,9 @@ __all__.extend([ 'TestSCons_time',
])
SConstruct = """\
+from __future__ import print_function
import os
-print "SConstruct file directory:", os.getcwd()
+print("SConstruct file directory:", os.getcwd())
"""
scons_py = """\
@@ -43,7 +44,7 @@ def write_args(fp, args):
write_args(sys.stdout, sys.argv)
for arg in sys.argv[1:]:
if arg[:10] == '--profile=':
- profile = open(arg[10:], 'wb')
+ profile = open(arg[10:], 'w')
profile.write('--profile\\n')
write_args(profile, sys.argv)
break
@@ -270,7 +271,7 @@ class TestSCons_time(TestCommon):
tar = tarfile.open(archive, mode[suffix])
for name, content in files:
path = os.path.join(dir, name)
- open(path, 'wb').write(content)
+ open(path, 'wb').write(bytearray(content,'utf-8'))
tarinfo = tar.gettarinfo(path, path)
tarinfo.uid = 111
tarinfo.gid = 111
diff --git a/test/scons-time/run/config/scons.py b/test/scons-time/run/config/scons.py
index 73f041d..0c8b643 100644
--- a/test/scons-time/run/config/scons.py
+++ b/test/scons-time/run/config/scons.py
@@ -42,13 +42,14 @@ scons = r'%(my_scons_py)s'
""" % locals())
test.write(my_scons_py, """\
+from __future__ import print_function
import sys
profile = ''
for arg in sys.argv[1:]:
if arg.startswith('--profile='):
profile = arg[10:]
break
-print 'my_scons.py: %s' % profile
+print('my_scons.py: %s' % profile)
""")
test.run(arguments = 'run -f config foo.tar.gz')
diff --git a/test/scons-time/run/option/scons.py b/test/scons-time/run/option/scons.py
index 0bf883b..71d8ca2 100644
--- a/test/scons-time/run/option/scons.py
+++ b/test/scons-time/run/option/scons.py
@@ -43,7 +43,7 @@ for arg in sys.argv[1:]:
if arg.startswith('--profile='):
profile = arg[10:]
break
-print 'my_scons.py: %s' % profile
+print('my_scons.py: %s' % profile)
""")
test.run(arguments = 'run --scons %s foo.tar.gz' % my_scons_py)