summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussel Winder <russel@winder.org.uk>2016-01-01 15:01:27 +0000
committerRussel Winder <russel@winder.org.uk>2016-01-01 15:01:27 +0000
commit533ab8598e0f32928589a5f8061dbe191a095b46 (patch)
tree7fdc13c5731ee72d402b6ac19c52b506df77d574
parent0b1be9f0d5520e3a541a7c4d026ba4145a618dec (diff)
downloadscons-533ab8598e0f32928589a5f8061dbe191a095b46.tar.gz
Some more print statements to functions.
-rw-r--r--SConstruct5
-rw-r--r--doc/SConscript3
-rw-r--r--src/engine/SCons/SConsign.py10
-rw-r--r--src/engine/SCons/compat/sixTests.py4
-rw-r--r--src/engine/SCons/dblite.py1
-rw-r--r--src/script/sconsign.py3
-rw-r--r--test/ARGLIST.py2
-rw-r--r--test/Actions/pre-post.py22
-rw-r--r--test/AddMethod.py8
-rw-r--r--test/AddOption/basic.py4
-rw-r--r--test/CC/CFLAGS.py10
-rw-r--r--test/packaging/convenience-functions/image/SConstruct5
12 files changed, 40 insertions, 37 deletions
diff --git a/SConstruct b/SConstruct
index 8734c2e2..1616fc27 100644
--- a/SConstruct
+++ b/SConstruct
@@ -2,6 +2,7 @@
# SConstruct file to build scons packages during development.
#
# See the README.rst file for an overview of how SCons is built and tested.
+
from __future__ import print_function
copyright_years = '2001 - 2015'
@@ -162,7 +163,7 @@ import distutils.command
no_winpack_templates = not os.path.exists(os.path.join(os.path.split(distutils.command.__file__)[0],'wininst-9.0.exe'))
skip_win_packages = ARGUMENTS.get('SKIP_WIN_PACKAGES',False) or no_winpack_templates
if skip_win_packages:
- print "Skipping the build of Windows packages..."
+ print("Skipping the build of Windows packages...")
python_ver = sys.version[0:3]
@@ -1049,7 +1050,7 @@ for p in [ scons ]:
# The built deb is called just x.y.z, not x.y.z.final.0 so strip those off:
deb_version = '.'.join(version.split('.')[0:3])
deb = os.path.join(build_dir, 'dist', "%s_%s_all.deb" % (pkg, deb_version))
- # print "Building deb into %s (version=%s)"%(deb, deb_version)
+ # print("Building deb into %s (version=%s)"%(deb, deb_version))
for d in p['debian_deps']:
b = env.SCons_revision(os.path.join(build, d), d)
env.Depends(deb, b)
diff --git a/doc/SConscript b/doc/SConscript
index 6dbf33de..7e6aaeba 100644
--- a/doc/SConscript
+++ b/doc/SConscript
@@ -23,6 +23,7 @@
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
from __future__ import print_function
import os.path
@@ -52,7 +53,7 @@ fop = whereis('fop')
xep = whereis('xep')
if not fop and not xep:
- print "doc: No PDF renderer found (fop|xep)!"
+ print("doc: No PDF renderer found (fop|xep)!")
skip_doc = True
#
diff --git a/src/engine/SCons/SConsign.py b/src/engine/SCons/SConsign.py
index 970c35c3..cb089aa0 100644
--- a/src/engine/SCons/SConsign.py
+++ b/src/engine/SCons/SConsign.py
@@ -26,6 +26,7 @@ Writing and reading information to the .sconsign file or files.
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
+
from __future__ import print_function
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
@@ -33,7 +34,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import SCons.compat
import os
-# compat layer imports "cPickle" for us if it's available.
import pickle
import SCons.dblite
@@ -125,16 +125,16 @@ class SConsignEntry(object):
"""
__slots__ = ("binfo", "ninfo", "__weakref__")
current_version_id = 2
-
+
def __init__(self):
# Create an object attribute from the class attribute so it ends up
# in the pickled data in the .sconsign file.
#_version_id = self.current_version_id
pass
-
+
def convert_to_sconsign(self):
self.binfo.convert_to_sconsign()
-
+
def convert_from_sconsign(self, dir, name):
self.binfo.convert_from_sconsign(dir, name)
@@ -156,7 +156,7 @@ class SConsignEntry(object):
for key, value in state.items():
if key not in ('_version_id','__weakref__'):
setattr(self, key, value)
-
+
class Base(object):
"""
This is the controlling class for the signatures for the collection of
diff --git a/src/engine/SCons/compat/sixTests.py b/src/engine/SCons/compat/sixTests.py
index 71df78d6..8be35722 100644
--- a/src/engine/SCons/compat/sixTests.py
+++ b/src/engine/SCons/compat/sixTests.py
@@ -1,4 +1,3 @@
-from __future__ import print_function
#
# __COPYRIGHT__
#
@@ -22,6 +21,8 @@ from __future__ import print_function
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
+from __future__ import print_function
+
import unittest
class sixTestCase(unittest.TestCase):
@@ -32,4 +33,3 @@ class sixTestCase(unittest.TestCase):
print(sys.path)
from SCons.compat.six import PY2, PY3
self.assertTrue(PY2 or PY3)
-
diff --git a/src/engine/SCons/dblite.py b/src/engine/SCons/dblite.py
index 3be6cb20..b12d320a 100644
--- a/src/engine/SCons/dblite.py
+++ b/src/engine/SCons/dblite.py
@@ -5,7 +5,6 @@ from __future__ import print_function
import SCons.compat
import os
-# compat layer imports "cPickle" for us if it's available.
import pickle
import shutil
import time
diff --git a/src/script/sconsign.py b/src/script/sconsign.py
index 1a4caf7d..daf088e1 100644
--- a/src/script/sconsign.py
+++ b/src/script/sconsign.py
@@ -22,6 +22,7 @@
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
from __future__ import print_function
from SCons.compat.six import PY2, PY3
@@ -185,7 +186,7 @@ sys.path = libs + sys.path
# END STANDARD SCons SCRIPT HEADER
##############################################################################
-import SCons.compat # so pickle will import cPickle instead
+import SCons.compat
if PY2:
import whichdb
diff --git a/test/ARGLIST.py b/test/ARGLIST.py
index 186ad069..e246ba32 100644
--- a/test/ARGLIST.py
+++ b/test/ARGLIST.py
@@ -31,7 +31,7 @@ test = TestSCons.TestSCons()
test.write('SConstruct', """
i = 0
for key, value in ARGLIST:
- print "%d: %s = %s" % (i, key, value)
+ print("%d: %s = %s" % (i, key, value))
i = i + 1
""")
diff --git a/test/Actions/pre-post.py b/test/Actions/pre-post.py
index e09ee028..179e9143 100644
--- a/test/Actions/pre-post.py
+++ b/test/Actions/pre-post.py
@@ -118,14 +118,14 @@ def b(target, source, env):
env1 = Environment(X='111')
env2 = Environment(X='222')
B = Builder(action = b, env = env1, multi=1)
-print "B =", B
-print "B.env =", B.env
+print("B =", B)
+print("B.env =", B.env)
env1.Append(BUILDERS = {'B' : B})
env2.Append(BUILDERS = {'B' : B})
env3 = env1.Clone(X='333')
-print "env1 =", env1
-print "env2 =", env2
-print "env3 =", env3
+print("env1 =", env1)
+print("env2 =", env2)
+print("env3 =", env3)
f1 = env1.B(File('file1.out'), [])
f2 = env2.B('file2.out', [])
f3 = env3.B('file3.out', [])
@@ -133,12 +133,12 @@ def do_nothing(env, target, source):
pass
AddPreAction(f2[0], do_nothing)
AddPostAction(f3[0], do_nothing)
-print "f1[0].builder =", f1[0].builder
-print "f2[0].builder =", f2[0].builder
-print "f3[0].builder =", f3[0].builder
-print "f1[0].env =", f1[0].env
-print "f2[0].env =", f2[0].env
-print "f3[0].env =", f3[0].env
+print("f1[0].builder =", f1[0].builder)
+print("f2[0].builder =", f2[0].builder)
+print("f3[0].builder =", f3[0].builder)
+print("f1[0].env =", f1[0].env)
+print("f2[0].env =", f2[0].env)
+print("f3[0].env =", f3[0].env)
""")
test.run(chdir='work2', arguments = '.')
diff --git a/test/AddMethod.py b/test/AddMethod.py
index af84cb34..6049ae2f 100644
--- a/test/AddMethod.py
+++ b/test/AddMethod.py
@@ -40,10 +40,10 @@ def foo(self):
AddMethod(Environment, foo)
env = Environment(FOO = '111')
-print env.foo()
+print(env.foo())
env = Environment(FOO = '222')
-print env.foo()
+print(env.foo())
env.AddMethod(foo, 'bar')
env['FOO'] = '333'
@@ -51,8 +51,8 @@ env['FOO'] = '333'
e = env.Clone()
e['FOO'] = '444'
-print env.bar()
-print e.bar()
+print(env.bar())
+print(e.bar())
""")
expect = """\
diff --git a/test/AddOption/basic.py b/test/AddOption/basic.py
index a1bb7b33..b1b8f2e1 100644
--- a/test/AddOption/basic.py
+++ b/test/AddOption/basic.py
@@ -48,8 +48,8 @@ AddOption('--prefix',
f = GetOption('force')
if f:
f = "True"
-print f
-print GetOption('prefix')
+print(f)
+print(GetOption('prefix'))
""")
test.run('-Q -q .',
diff --git a/test/CC/CFLAGS.py b/test/CC/CFLAGS.py
index 6ea87adb..590d6b54 100644
--- a/test/CC/CFLAGS.py
+++ b/test/CC/CFLAGS.py
@@ -32,10 +32,10 @@ test = TestSCons.TestSCons()
# Make sure CFLAGS is not passed to CXX by just expanding CXXCOM
test.write('SConstruct', """
env = Environment(CFLAGS='-xyz', CCFLAGS='-abc')
-print env.subst('$CXXCOM')
-print env.subst('$CXXCOMSTR')
-print env.subst('$SHCXXCOM')
-print env.subst('$SHCXXCOMSTR')
+print(env.subst('$CXXCOM'))
+print(env.subst('$CXXCOMSTR'))
+print(env.subst('$SHCXXCOM'))
+print(env.subst('$SHCXXCOMSTR'))
""")
test.run(arguments = '.')
test.must_not_contain_any_line(test.stdout(), ["-xyz"])
@@ -46,7 +46,7 @@ _obj = TestSCons._obj
# Test passing CFLAGS to C compiler by actually compiling programs
if sys.platform == 'win32':
import SCons.Tool.MSCommon as msc
-
+
if not msc.msvc_exists():
fooflags = '-DFOO'
barflags = '-DBAR'
diff --git a/test/packaging/convenience-functions/image/SConstruct b/test/packaging/convenience-functions/image/SConstruct
index 461961ed..f35c3e30 100644
--- a/test/packaging/convenience-functions/image/SConstruct
+++ b/test/packaging/convenience-functions/image/SConstruct
@@ -1,3 +1,4 @@
+from __future__ import print_function
env = Environment(tools=['default', 'packaging'])
prog = env.Install( 'bin/', ["f1", "f2"] )
@@ -6,5 +7,5 @@ env.File( "f3" )
src_files = sorted(map(str, env.FindSourceFiles()))
oth_files = sorted(map(str, env.FindInstalledFiles()))
-print src_files
-print oth_files
+print(src_files)
+print(oth_files)