diff --git a/SConstruct b/SConstruct index d07b09b48..322cd1d2e 100644 --- a/SConstruct +++ b/SConstruct @@ -864,6 +864,7 @@ if env['HAS_SUNDIALS'] and env['use_sundials'] != 'n': env = conf.Finish() +env['python_cmd_esc'] = quoted(env['python_cmd']) # Python 2 Package Settings cython_min_version = LooseVersion('0.17') @@ -1253,7 +1254,7 @@ for cti in mglob(env, 'data/inputs', 'cti'): outName = os.path.splitext(cti.name)[0] + '.xml' convertedInputFiles.add(outName) build(env.Command('build/data/%s' % outName, cti.path, - '$python_cmd interfaces/python/ctml_writer.py $SOURCE $TARGET')) + '$python_cmd_esc interfaces/python/ctml_writer.py $SOURCE $TARGET')) # Copy input files which are not present as cti: diff --git a/interfaces/cython/SConscript b/interfaces/cython/SConscript index c5f96adb1..61833d771 100644 --- a/interfaces/cython/SConscript +++ b/interfaces/cython/SConscript @@ -192,7 +192,7 @@ if localenv['python_package'] == 'new': build(make_setup) build_base = ('cd interfaces/cython &&' - ' $python_cmd setup2.py %s' + ' $python_cmd_esc setup2.py %s' ' --build-lib=../../build/python2' ' --build-temp=../../build/temp-py2' + compilerOpt) diff --git a/src/python/SConscript b/src/python/SConscript index d114baf51..928db3f28 100644 --- a/src/python/SConscript +++ b/src/python/SConscript @@ -72,8 +72,8 @@ elif localenv['python_package'] == 'minimal': moddir = pjoin('interfaces', 'python') localenv.AddPostAction(make_setup, - 'cd %s && $python_cmd setup.py build %s' % (moddir, - extraArgs)) + 'cd %s && $python_cmd_esc setup.py build %s' % (moddir, + extraArgs)) # Install the Python module if localenv['python_prefix'] == 'USER': @@ -88,7 +88,7 @@ else: if localenv['PYTHON_INSTALLER'] == 'direct': mod_inst = install(localenv.Command, 'dummy', pymodule, - 'cd %s && $python_cmd setup.py install %s' % (moddir,extra) + + 'cd %s && $python_cmd_esc setup.py install %s' % (moddir,extra) + ' --record ../../build/python-installed-files.txt') global_env = env def find_module_dir(target, source, env): @@ -104,11 +104,11 @@ if localenv['PYTHON_INSTALLER'] == 'direct': elif localenv['PYTHON_INSTALLER'] == 'debian': install(localenv.Command, 'dummy', pymodule, - 'cd %s && $python_cmd setup.py install %s --install-layout=deb --no-compile' % (moddir,extra)) + 'cd %s && $python_cmd_esc setup.py install %s --install-layout=deb --no-compile' % (moddir,extra)) env['python_module_loc'] = '' elif localenv['PYTHON_INSTALLER'] == 'binary': install(localenv.Command, 'dummy', pymodule, - 'cd %s && $python_cmd setup.py bdist_msi --dist-dir=../..' % moddir + + 'cd %s && $python_cmd_esc setup.py bdist_msi --dist-dir=../..' % moddir + ' --target-version=' + distutils.sysconfig.get_python_version()) env['python_module_loc'] = ''