Fixed an environment issue with Python subprocesses

This commit is contained in:
Ray Speth 2012-03-09 22:54:21 +00:00
parent 66ada1c423
commit 50bef3ee5c
3 changed files with 13 additions and 4 deletions

View file

@ -116,6 +116,10 @@ env = Environment(tools=toolchain+['textfile', 'subst', 'recursiveInstall', 'wix
if os.name == 'nt' and 'TMP' in os.environ:
env['ENV']['TMP'] = os.environ['TMP']
# Fixes issues with Python subprocesses. See http://bugs.python.org/issue13524
if os.name == 'nt':
env['ENV']['SystemRoot'] = os.environ['SystemRoot']
# Fix an issue with Unicode sneaking into the environment on Windows
if os.name == 'nt':
for key,val in env['ENV'].iteritems():

View file

@ -32,13 +32,16 @@ if localenv['python_package'] == 'full':
cantera_libname = 'cantera_shared' if os.name=='nt' else 'cantera'
pylinklibs = [cantera_libname]
# On Windows, we need to link against the Python "import" library.
# With MSVC, this is automatically handled by a "#pragma comment
# directive in the Python headers, but for MinGW we need to do
# it manually.
if localenv['toolchain'] == 'mingw':
# On Windows, we need to link against the Python "import" library.
# With MSVC, this is automatically handled by a "#pragma comment
# directive in the Python headers, but for MinGW we need to do
# it manually.
pylinklibs.append('python%s' % gcv('VERSION'))
# Link statically so we don't have to include a copy of libstdc++
localenv.Append(LINKFLAGS=['-static-libgcc', '-static-libstdc++'])
# OS X requires library dependencies to be specified at link time
if localenv['OS'] == 'Darwin':
pylinklibs.append('python%s' % gcv('VERSION'))

View file

@ -4,6 +4,7 @@ Unit tests for the Cantera Python module.
This script gathers all the tests defined in all of the test<foo>.py
files, runs them, and prints a report.
"""
import sys
import unittest
import Cantera
@ -11,6 +12,7 @@ import Cantera
if __name__ == '__main__':
print '\n* INFO: using Cantera module found at this location:'
print '* ', repr(Cantera.__file__), '\n'
sys.stdout.flush()
loader = unittest.TestLoader()
runner = unittest.TextTestRunner(verbosity=2)