diff options
author | William Deegan <bill@baddogconsulting.com> | 2018-07-08 19:04:06 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2018-07-08 19:04:06 (GMT) |
commit | f90b61a1eb5da911786db6b1606a6652457a4240 (patch) | |
tree | 2296772710d8f4ac2f6b43e05fa968d7739fc789 | |
parent | 77298ddfa1c2cce17fe722bdccad93fb93f9618a (diff) | |
download | SCons-f90b61a1eb5da911786db6b1606a6652457a4240.zip SCons-f90b61a1eb5da911786db6b1606a6652457a4240.tar.gz SCons-f90b61a1eb5da911786db6b1606a6652457a4240.tar.bz2 |
Fix for py2.7 + 3.5+
-rw-r--r-- | test/SWIG/live.py | 1 | ||||
-rw-r--r-- | testing/framework/TestSCons.py | 13 |
2 files changed, 9 insertions, 5 deletions
diff --git a/test/SWIG/live.py b/test/SWIG/live.py index 684cff1..7c4bdce 100644 --- a/test/SWIG/live.py +++ b/test/SWIG/live.py @@ -46,6 +46,7 @@ swig = test.where_is('swig') if not swig: test.skip_test('Can not find installed "swig", skipping test.\n') + python, python_include, python_libpath, python_lib = \ test.get_platform_python_info() Python_h = python_include + '/Python.h' diff --git a/testing/framework/TestSCons.py b/testing/framework/TestSCons.py index 767570d..c9de47a 100644 --- a/testing/framework/TestSCons.py +++ b/testing/framework/TestSCons.py @@ -1264,12 +1264,12 @@ SConscript( sconscript ) Returns: (path to python, include path, library path, library name) """ - python = os.environ.get('python_executable',self.where_is('python')) + python = os.environ.get('python_executable', self.where_is('python')) if not python: self.skip_test('Can not find installed "python", skipping test.\n') if sys.platform == 'win32': - self.run(program = python, stdin = """\ + self.run(program=python, stdin="""\ import sysconfig try: if sys.platform == 'win32': @@ -1293,11 +1293,14 @@ except: print(py_ver) """) else: - self.run(program = python, stdin = """\ -import sysconfig + self.run(program=python, stdin="""\ +import sys, sysconfig print(sysconfig.get_config_var("INCLUDEPY")) print(sysconfig.get_config_var("LIBDIR")) -print("python"+sysconfig.get_config_var("LDVERSION")) +py_library_ver = sysconfig.get_config_var("LDVERSION") +if not py_library_ver: + py_library_ver = '%d.%d' % sys.version_info[:2] +print("python"+py_library_ver) """) return [python] + self.stdout().strip().split('\n') |