diff options
author | Paweł Tomulik <ptomulik@meil.pw.edu.pl> | 2018-10-22 19:26:30 (GMT) |
---|---|---|
committer | Paweł Tomulik <ptomulik@meil.pw.edu.pl> | 2018-10-22 19:26:30 (GMT) |
commit | 76ff51ee816e39f98ee26393ac530e9d44a8c9bd (patch) | |
tree | 63dcacc37a07a9d6ef37cb47370ec1a50034a639 | |
parent | acd60358a5f20a6d82dab42c00ad16a5e07e6428 (diff) | |
download | SCons-76ff51ee816e39f98ee26393ac530e9d44a8c9bd.zip SCons-76ff51ee816e39f98ee26393ac530e9d44a8c9bd.tar.gz SCons-76ff51ee816e39f98ee26393ac530e9d44a8c9bd.tar.bz2 |
use absolute python path in sheabangs
-rw-r--r-- | test/ENV.py | 1 | ||||
-rw-r--r-- | test/SWIG/build-dir.py | 5 | ||||
-rw-r--r-- | test/Scanner/generated.py | 7 | ||||
-rw-r--r-- | test/TEX/biblatex_plain.py | 1 | ||||
-rw-r--r-- | test/explain/basic.py | 2 | ||||
-rw-r--r-- | test/long-lines/signature.py | 7 | ||||
-rw-r--r-- | test/scons-time/run/config/python.py | 7 | ||||
-rw-r--r-- | test/scons-time/run/option/python.py | 7 | ||||
-rw-r--r-- | test/sconsign/script/SConsignFile.py | 11 | ||||
-rw-r--r-- | test/sconsign/script/Signatures.py | 11 | ||||
-rw-r--r-- | test/sconsign/script/no-SConsignFile.py | 11 |
11 files changed, 38 insertions, 32 deletions
diff --git a/test/ENV.py b/test/ENV.py index 5972175..36ad844 100644 --- a/test/ENV.py +++ b/test/ENV.py @@ -25,7 +25,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os -import sys import TestSCons _python_ = TestSCons._python_ diff --git a/test/SWIG/build-dir.py b/test/SWIG/build-dir.py index 946c65c..bc105a5 100644 --- a/test/SWIG/build-dir.py +++ b/test/SWIG/build-dir.py @@ -139,9 +139,10 @@ public: }; """) +## _python_ = TestSCons._python_ ## XXX: @ptomulik: looks like it was unused? ## test.write(['source', 'test.py'], """\ -## #!/usr/bin/env python%s +## #!%(_python_)s ## from __future__ import print_function ## ## import linalg @@ -158,7 +159,7 @@ public: ## for i, v in enumerate(x): ## print("\tx[%%d] = %%g" %% (i, v)) ## -## """ % sys.version_info[0]) +## """ % locals()) test.run(arguments = '.') diff --git a/test/Scanner/generated.py b/test/Scanner/generated.py index 8c995be..3e08549 100644 --- a/test/Scanner/generated.py +++ b/test/Scanner/generated.py @@ -34,9 +34,10 @@ factors triggered the bug Scott saw, and partly because the real-world complexity is valuable in its own right. """ -import sys import TestSCons +_python_ = TestSCons._python_ + test = TestSCons.TestSCons() test.subdir('reftree', @@ -283,7 +284,7 @@ recurse_env.Command([lib_fullname] + lib_objs, """) test.write(['src', 'lib_geng', 'MAKE-HEADER.py'], """\ -#!/usr/bin/env python%s +#!%(_python_)s import os import os.path @@ -294,7 +295,7 @@ os.chdir(os.path.split(sys.argv[0])[0]) for h in ['libg_gx.h', 'libg_gy.h', 'libg_gz.h']: open(h, 'w').write('') -""" % sys.version_info[0]) +""" % locals()) test.write(['src', 'lib_geng', 'SConstruct'], """\ import os diff --git a/test/TEX/biblatex_plain.py b/test/TEX/biblatex_plain.py index 96a8476..06b3cc6 100644 --- a/test/TEX/biblatex_plain.py +++ b/test/TEX/biblatex_plain.py @@ -32,7 +32,6 @@ Test courtesy Rob Managan. import TestSCons import os -import sys test = TestSCons.TestSCons() diff --git a/test/explain/basic.py b/test/explain/basic.py index 4dfe47b..99942cd 100644 --- a/test/explain/basic.py +++ b/test/explain/basic.py @@ -51,7 +51,7 @@ inc_bbb_k = test.workpath('inc', 'bbb.k') -test.write(cat_py, r""" +test.write(cat_py, r"""\ from __future__ import print_function import sys diff --git a/test/long-lines/signature.py b/test/long-lines/signature.py index 480a27c..8330fef 100644 --- a/test/long-lines/signature.py +++ b/test/long-lines/signature.py @@ -30,15 +30,16 @@ surrounded by $( $) from the signature calculation. """ import os -import sys import TestSCons +_python_ = TestSCons._python_ + test = TestSCons.TestSCons() build_py = test.workpath('build.py') test.write(build_py, """\ -#!/usr/bin/env python%s +#!%(_python_)s import sys if sys.argv[1][0] == '@': args = open(sys.argv[1][1:], 'rb').read() @@ -49,7 +50,7 @@ fp = open(args[0], 'wb') fp.write(open(args[1], 'rb').read()) fp.write('FILEFLAG=%%s\\n' %% args[2]) fp.write('TIMESTAMP=%%s\\n' %% args[3]) -""" % sys.version_info[0]) +""" % locals()) os.chmod(build_py, 0o755) diff --git a/test/scons-time/run/config/python.py b/test/scons-time/run/config/python.py index 92d1600..c8842c1 100644 --- a/test/scons-time/run/config/python.py +++ b/test/scons-time/run/config/python.py @@ -29,10 +29,11 @@ Verify specifying an alternate Python executable in a config file. """ import os -import sys import TestSCons_time +_python_ = TestSCons_time._python_ + test = TestSCons_time.TestSCons_time() test.write_sample_project('foo.tar.gz') @@ -44,7 +45,7 @@ python = r'%(my_python_py)s' """ % locals()) test.write(my_python_py, """\ -#!/usr/bin/env python%s +#!%(_python_)s from __future__ import print_function import sys profile = '' @@ -53,7 +54,7 @@ for arg in sys.argv[1:]: profile = arg[10:] break print('my_python.py: %%s' %% profile) -""" % sys.version_info[0]) +""" % locals()) os.chmod(my_python_py, 0o755) diff --git a/test/scons-time/run/option/python.py b/test/scons-time/run/option/python.py index e508e11..27ca072 100644 --- a/test/scons-time/run/option/python.py +++ b/test/scons-time/run/option/python.py @@ -29,10 +29,11 @@ Verify the run --python option to specify an alternatie Python executable. """ import os -import sys import TestSCons_time +_python_ = TestSCons_time._python_ + test = TestSCons_time.TestSCons_time() test.write_sample_project('foo.tar.gz') @@ -40,7 +41,7 @@ test.write_sample_project('foo.tar.gz') my_python_py = test.workpath('my_python.py') test.write(my_python_py, """\ -#!/usr/bin/env python%s +#!%(_python_)s import sys profile = '' for arg in sys.argv[1:]: @@ -48,7 +49,7 @@ for arg in sys.argv[1:]: profile = arg[10:] break sys.stdout.write('my_python.py: %%s\\n' %% profile) -""" % sys.version_info[0]) +""" % locals()) os.chmod(my_python_py, 0o755) diff --git a/test/sconsign/script/SConsignFile.py b/test/sconsign/script/SConsignFile.py index 4adf43d..e9eba66 100644 --- a/test/sconsign/script/SConsignFile.py +++ b/test/sconsign/script/SConsignFile.py @@ -30,10 +30,11 @@ using the signatures in an SConsignFile(). """ import re -import sys import TestSCons import TestSConsign +_python_ = TestSCons._python_ + test = TestSConsign.TestSConsign(match = TestSConsign.match_re) test.subdir('sub1', 'sub2') @@ -41,7 +42,7 @@ test.subdir('sub1', 'sub2') fake_cc_py = test.workpath('fake_cc.py') fake_link_py = test.workpath('fake_link.py') -test.write(fake_cc_py, r"""#!/usr/bin/env python%s +test.write(fake_cc_py, r"""#!%(_python_)s import os import re import sys @@ -71,9 +72,9 @@ def process(infp, outfp): process(input, output) sys.exit(0) -""" % sys.version_info[0]) +""" % locals()) -test.write(fake_link_py, r"""#!/usr/bin/env python%s +test.write(fake_link_py, r"""#!%(_python_)s import sys output = open(sys.argv[1], 'wb') @@ -84,7 +85,7 @@ output.write('fake_link.py: %%s\n' %% sys.argv) output.write(input.read()) sys.exit(0) -""" % sys.version_info[0]) +""" % locals()) test.chmod(fake_cc_py, 0o755) test.chmod(fake_link_py, 0o755) diff --git a/test/sconsign/script/Signatures.py b/test/sconsign/script/Signatures.py index 9504ce4..0c6dfb5 100644 --- a/test/sconsign/script/Signatures.py +++ b/test/sconsign/script/Signatures.py @@ -35,7 +35,8 @@ SourceSignatures('timestamp') with TargetSignatures('content'). import TestSCons import TestSConsign -import sys + +_python_ = TestSCons._python_ test = TestSConsign.TestSConsign(match = TestSConsign.match_re) @@ -61,7 +62,7 @@ test.subdir('sub1', 'sub2') fake_cc_py = test.workpath('fake_cc.py') fake_link_py = test.workpath('fake_link.py') -test.write(fake_cc_py, r"""#!/usr/bin/env python%s +test.write(fake_cc_py, r"""#!%(_python_)s import os import re import sys @@ -91,9 +92,9 @@ def process(infp, outfp): process(input, output) sys.exit(0) -""" % sys.version_info[0]) +""" % locals()) -test.write(fake_link_py, r"""#!/usr/bin/env python%s +test.write(fake_link_py, r"""#!%(_python_)s import sys output = open(sys.argv[1], 'wb') @@ -104,7 +105,7 @@ output.write('fake_link.py: %%s\n' %% sys.argv) output.write(input.read()) sys.exit(0) -""" % sys.version_info[0]) +""" % locals()) test.chmod(fake_cc_py, 0o755) test.chmod(fake_link_py, 0o755) diff --git a/test/sconsign/script/no-SConsignFile.py b/test/sconsign/script/no-SConsignFile.py index 3973fc3..6c892e1 100644 --- a/test/sconsign/script/no-SConsignFile.py +++ b/test/sconsign/script/no-SConsignFile.py @@ -31,7 +31,8 @@ Verify that the sconsign script works when using an individual import TestSCons import TestSConsign -import sys + +_python_ = TestSCons._python_ test = TestSConsign.TestSConsign(match = TestSConsign.match_re) @@ -50,7 +51,7 @@ test.subdir('sub1', 'sub2') fake_cc_py = test.workpath('fake_cc.py') fake_link_py = test.workpath('fake_link.py') -test.write(fake_cc_py, r"""#!/usr/bin/env python%s +test.write(fake_cc_py, r"""#!%(_python_)s import os import re import sys @@ -80,9 +81,9 @@ def process(infp, outfp): process(input, output) sys.exit(0) -""" % sys.version_info[0]) +""" % locals()) -test.write(fake_link_py, r"""#!/usr/bin/env python%s +test.write(fake_link_py, r"""#!%(_python_)s import sys output = open(sys.argv[1], 'wb') @@ -93,7 +94,7 @@ output.write('fake_link.py: %%s\n' %% sys.argv) output.write(input.read()) sys.exit(0) -""" % sys.version_info[0]) +""" % locals()) test.chmod(fake_cc_py, 0o755) test.chmod(fake_link_py, 0o755) |