diff options
Diffstat (limited to 'QMTest/TestSCons_time.py')
-rw-r--r-- | QMTest/TestSCons_time.py | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/QMTest/TestSCons_time.py b/QMTest/TestSCons_time.py index e84f7dc..f74906a 100644 --- a/QMTest/TestSCons_time.py +++ b/QMTest/TestSCons_time.py @@ -11,9 +11,9 @@ from those classes, as well as any overridden or additional methods or attributes defined in this subclass. """ -# Copyright (c) 2001 - 2016 The SCons Foundation +# Copyright (c) 2001 - 2017 The SCons Foundation -__revision__ = "QMTest/TestSCons_time.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog" +__revision__ = "QMTest/TestSCons_time.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os import os.path @@ -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,12 +44,12 @@ 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 sys.stdout.write('SCONS_LIB_DIR = ' + os.environ['SCONS_LIB_DIR'] + '\\n') -exec(open('SConstruct', 'rU').read()) +exec(open('SConstruct', 'r').read()) """ aegis_py = """\ @@ -225,7 +226,7 @@ class TestSCons_time(TestCommon): def write_fake_aegis_py(self, name): name = self.workpath(name) self.write(name, aegis_py) - os.chmod(name, 0755) + os.chmod(name, 0o755) return name def write_fake_scons_py(self): @@ -235,7 +236,7 @@ class TestSCons_time(TestCommon): def write_fake_svn_py(self, name): name = self.workpath(name) self.write(name, svn_py) - os.chmod(name, 0755) + os.chmod(name, 0o755) return name def write_sample_directory(self, archive, dir, files): @@ -245,7 +246,7 @@ class TestSCons_time(TestCommon): d, f = os.path.split(path) if not os.path.isdir(d): os.makedirs(d) - open(path, 'wb').write(content) + open(path, 'w').write(content) return dir def write_sample_tarfile(self, archive, dir, files): @@ -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 @@ -295,7 +296,7 @@ class TestSCons_time(TestCommon): zip = zipfile.ZipFile(archive, 'w') for name, content in files: path = os.path.join(dir, name) - open(path, 'wb').write(content) + open(path, 'w').write(content) zip.write(path) zip.close() shutil.rmtree(dir) |