diff --git a/SConstruct b/SConstruct index 41b467e976aa29985e80bab4ccf01c6f86236816..ae85cda17302df123055be3ce4d54d440ab5e6ee 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 069472164a8255595db0c2d8f9e951ba5fdfe6d3..b34b85a1cd469386b752bc3721a8b54954315e2a 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 3ffe304cb1e2cc95a068885b2ab40c6c8ad3154e..0233ff746609bffde6ec1785bbfc54da3068b93b 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 f0676ebbed630beed69ba3f7bef29e7bda8a3d7d..2c4d6e040651ce7f9a5bc7b4a2b26fe7c7032380 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 6b5f8db16aab26b1efff6e8f8356db0791020e1c..3b023dd3954181844ad802b8221967176538542f 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 a46ddacc20090cde7072cddae9be1a8fdbe56a57..4bd6c28c23e45e9b1665d4812cb01e6c98cc789a 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 9555b9888055d1d5fed222aa6fee4ea80274cbb8..385759e0db71d5d005ecd63d1d5230b9cbd6d8fe 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 94f874ee41cc4741cff950ef4a88478dcfc06b31..62e4b2275a0b0bcdc15c87218effc3601e8a7241 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 49b693a7035cabfe1914c0a2fc172d31a07e23dd..e3e37c6a53e859b32a107cabafe5c3f0ecaeef46 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 34728af238c9a1b3ad478737e997921e8a0ff0b8..284680070a5791b68822a2e07abc95496c8053de 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 dac2d9596a58fdd2e8dd4edbcde46aa31b4d6024..d5d092dda8e86fc04f3a3a8be85bdd421badda72 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 45a63f49ffe42384a1f3025b0c02eb85264462e5..ee79caa3970cf32dbf602811957c7155e1db231a 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 6d85a9329d033cf1d247163f6dd3d078fc08746c..d50b644c9c77d5cee653317a346da9eb60182e56 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 af4f51983579fa5ccfd0d522971b0a48ed6a27bf..fbc9d30e0794cd28a745d9cae5be90ec6762e1c4 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 6b38b45319dc406bb1ea81ea1a8919d4c7af0028..f10fc71f192665596d9d0528c909bedf8594d108 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 a2cc380e7ab8fe4b7aa5face89b51898927f56a5..99c509c1da14bd6ad0d2472391b7024508fd9f55 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 5321e4813d9ee0030964c4dd1bcf207710808037..81a167ef48da027e59d5d2367fa21dd16e1d71c6 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):