diff --git a/SConstruct b/SConstruct index 41b467e..ae85cda 100644 --- a/SConstruct +++ b/SConstruct @@ -1,4 +1,7 @@ # -*- python -*- + +from __future__ import absolute_import, division, print_function + import os import os.path import platform @@ -43,9 +46,9 @@ env['prefix'] = os.path.abspath(env['prefix']) if 'DESTDIR' in env: env['DESTDIR'] = os.path.abspath(env['DESTDIR']) if rel_prefix: - print >>sys.stderr, '--!!-- You used a relative prefix with a DESTDIR. This is probably not what you' - print >>sys.stderr, '--!!-- you want; files will be installed in' - print >>sys.stderr, '--!!-- %s' % (calcInstallPath('$prefix'),) + print('--!!-- You used a relative prefix with a DESTDIR. This is probably not what you', file=sys.stderr) + print('--!!-- you want; files will be installed in', file=sys.stderr) + print('--!!-- %s' % (calcInstallPath('$prefix'),), file=sys.stderr) env['libpath'] = calcInstallPath('$prefix', 'lib') diff --git a/examples/SConscript b/examples/SConscript index 0694721..b34b85a 100644 --- a/examples/SConscript +++ b/examples/SConscript @@ -1,3 +1,5 @@ +from __future__ import absolute_import, division, print_function + Import('env') example = env.Clone() diff --git a/examples/base64.py b/examples/base64.py index 3ffe304..0233ff7 100644 --- a/examples/base64.py +++ b/examples/base64.py @@ -10,7 +10,7 @@ # base64_sem1.py and base64_sem2.py for examples how to attach appropriate # semantic actions to the grammar. -from __future__ import print_function +from __future__ import absolute_import, division, print_function import sys diff --git a/examples/base64_sem1.py b/examples/base64_sem1.py index f0676eb..2c4d6e0 100644 --- a/examples/base64_sem1.py +++ b/examples/base64_sem1.py @@ -13,7 +13,7 @@ # transform the parse tree in small steps in a bottom-up fashion. Compare # base64_sem2.py for an alternative approach using a single top-level action. -from __future__ import print_function +from __future__ import absolute_import, division, print_function import functools import sys diff --git a/examples/base64_sem2.py b/examples/base64_sem2.py index 6b5f8db..3b023dd 100644 --- a/examples/base64_sem2.py +++ b/examples/base64_sem2.py @@ -14,7 +14,7 @@ # for an alternative approach using a fine-grained piece-by-piece # transformation. -from __future__ import print_function +from __future__ import absolute_import, division, print_function import functools import sys diff --git a/src/SConscript b/src/SConscript index a46ddac..4bd6c28 100644 --- a/src/SConscript +++ b/src/SConscript @@ -1,4 +1,7 @@ # -*- python -*- + +from __future__ import absolute_import, division, print_function + import os.path Import('env testruns') diff --git a/src/bindings/cpp/SConscript b/src/bindings/cpp/SConscript index 9555b98..385759e 100644 --- a/src/bindings/cpp/SConscript +++ b/src/bindings/cpp/SConscript @@ -1,4 +1,7 @@ # -*- python -*- + +from __future__ import absolute_import, division, print_function + import os.path Import("env libhammer_shared testruns targets") diff --git a/src/bindings/dotnet/SConscript b/src/bindings/dotnet/SConscript index 94f874e..62e4b22 100644 --- a/src/bindings/dotnet/SConscript +++ b/src/bindings/dotnet/SConscript @@ -1,4 +1,7 @@ # -*- python -*- + +from __future__ import absolute_import, division, print_function + import os.path Import("env libhammer_shared testruns targets") diff --git a/src/bindings/perl/SConscript b/src/bindings/perl/SConscript index 49b693a..e3e37c6 100644 --- a/src/bindings/perl/SConscript +++ b/src/bindings/perl/SConscript @@ -1,4 +1,7 @@ # -*- python -*- + +from __future__ import absolute_import, division, print_function + import os.path Import("env libhammer_shared testruns targets") diff --git a/src/bindings/php/SConscript b/src/bindings/php/SConscript index 34728af..2846800 100644 --- a/src/bindings/php/SConscript +++ b/src/bindings/php/SConscript @@ -1,4 +1,7 @@ # -*- python -*- + +from __future__ import absolute_import, division, print_function + import os, os.path Import('env libhammer_shared testruns') diff --git a/src/bindings/python/SConscript b/src/bindings/python/SConscript index dac2d95..d5d092d 100644 --- a/src/bindings/python/SConscript +++ b/src/bindings/python/SConscript @@ -1,4 +1,7 @@ # -*- python -*- + +from __future__ import absolute_import, division, print_function + import os, os.path Import('env libhammer_shared testruns targets') diff --git a/src/bindings/python/hammer_tests.py b/src/bindings/python/hammer_tests.py index 45a63f4..ee79caa 100644 --- a/src/bindings/python/hammer_tests.py +++ b/src/bindings/python/hammer_tests.py @@ -1,3 +1,5 @@ +from __future__ import absolute_import, division, print_function + import unittest import hammer as h diff --git a/src/bindings/ruby/SConscript b/src/bindings/ruby/SConscript index 6d85a93..d50b644 100644 --- a/src/bindings/ruby/SConscript +++ b/src/bindings/ruby/SConscript @@ -1,4 +1,7 @@ # -*- python -*- + +from __future__ import absolute_import, division, print_function + import os.path Import("env libhammer_shared testruns targets") diff --git a/tools/csharp/__init__.py b/tools/csharp/__init__.py index af4f519..fbc9d30 100644 --- a/tools/csharp/__init__.py +++ b/tools/csharp/__init__.py @@ -21,4 +21,6 @@ # 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 csharp import exists, generate +from __future__ import absolute_import, division, print_function + +from .csharp import exists, generate diff --git a/tools/csharp/csharp.py b/tools/csharp/csharp.py index 6b38b45..f10fc71 100644 --- a/tools/csharp/csharp.py +++ b/tools/csharp/csharp.py @@ -30,6 +30,8 @@ # This is an attempt to meld to two based initially on the Microsoft C# tool with amendmnets from the Mono # tool. +from __future__ import absolute_import, division, print_function + import os.path import SCons.Builder import SCons.Node.FS diff --git a/tools/csharp/mono.py b/tools/csharp/mono.py index a2cc380..99c509c 100644 --- a/tools/csharp/mono.py +++ b/tools/csharp/mono.py @@ -25,6 +25,8 @@ # This C# Tool for Mono taken from http://www.scons.org/wiki/CsharpBuilder. +from __future__ import absolute_import, division, print_function + import os.path import SCons.Builder import SCons.Node.FS diff --git a/tools/scanreplace.py b/tools/scanreplace.py index 5321e48..81a167e 100644 --- a/tools/scanreplace.py +++ b/tools/scanreplace.py @@ -1,3 +1,5 @@ +from __future__ import absolute_import, division, print_function + from string import Template def replace_action(target, source, env):