diff options
author | Craig Rodrigues <rodrigc@FreeBSD.org> | 2017-03-11 12:09:11 (GMT) |
---|---|---|
committer | Craig Rodrigues <rodrigc@FreeBSD.org> | 2017-03-11 12:09:11 (GMT) |
commit | c14936494d79a00b533e7e8ce9a41e5176c1295f (patch) | |
tree | 079546afb1d6be21831851837d10f4af1d738018 /QMTest | |
parent | 055c8046afce036fdfad4bc8d60e4059da148f7d (diff) | |
download | SCons-c14936494d79a00b533e7e8ce9a41e5176c1295f.zip SCons-c14936494d79a00b533e7e8ce9a41e5176c1295f.tar.gz SCons-c14936494d79a00b533e7e8ce9a41e5176c1295f.tar.bz2 |
Use print() function. Fixes py2/3
Diffstat (limited to 'QMTest')
-rw-r--r-- | QMTest/TestCommonTests.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/QMTest/TestCommonTests.py b/QMTest/TestCommonTests.py index 30b7d6a..7949cb8 100644 --- a/QMTest/TestCommonTests.py +++ b/QMTest/TestCommonTests.py @@ -168,10 +168,11 @@ class __init__TestCase(TestCommonTestCase): os.chdir(run_env.workdir) script = lstrip("""\ + from __future__ import print_function from TestCommon import TestCommon tc = TestCommon(workdir='') import os - print os.getcwd() + print(os.getcwd()) """) run_env.run(program=sys.executable, stdin=script) stdout = run_env.stdout()[:-1] @@ -2285,14 +2286,16 @@ class variables_TestCase(TestCommonTestCase): 'dll_suffix', ] - script = "import TestCommon\n" + \ - '\n'.join([ "print TestCommon.%s\n" % v for v in variables ]) + script = "from __future__ import print_function" + \ + "import TestCommon\n" + \ + '\n'.join([ "print(TestCommon.%s)\n" % v for v in variables ]) run_env.run(program=sys.executable, stdin=script) stderr = run_env.stderr() assert stderr == "", stderr - script = "from TestCommon import *\n" + \ - '\n'.join([ "print %s" % v for v in variables ]) + script = "from __future__ import print_function" + \ + "from TestCommon import *\n" + \ + '\n'.join([ "print(%s)" % v for v in variables ]) run_env.run(program=sys.executable, stdin=script) stderr = run_env.stderr() assert stderr == "", stderr |