summaryrefslogtreecommitdiff
path: root/QMTest/TestSCons_time.py
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-09-28 12:19:30 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-09-28 12:19:30 +0200
commit7c6dd0eee627772485f8b06470ac84adc0f077f6 (patch)
tree69a28021c01029c221f78be31c4cb0335922ebfe /QMTest/TestSCons_time.py
parent6be31f5d140b81227911cabfc61d3802c76c1b61 (diff)
parentbaee03c569c91b745a1e025660b19a718db16e7d (diff)
Updated version 3.0.0 from 'upstream/3.0.0'
with Debian dir 147caafe8506326dfd094432b42ae32c21ed284e
Diffstat (limited to 'QMTest/TestSCons_time.py')
-rw-r--r--QMTest/TestSCons_time.py21
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)