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 /testing | |
parent | 77298ddfa1c2cce17fe722bdccad93fb93f9618a (diff) | |
download | SCons-f90b61a1eb5da911786db6b1606a6652457a4240.zip SCons-f90b61a1eb5da911786db6b1606a6652457a4240.tar.gz SCons-f90b61a1eb5da911786db6b1606a6652457a4240.tar.bz2 |
Fix for py2.7 + 3.5+
Diffstat (limited to 'testing')
-rw-r--r-- | testing/framework/TestSCons.py | 13 |
1 files changed, 8 insertions, 5 deletions
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') |