Improved behavior of Python module when python isn't in the path
This commit is contained in:
parent
59083268fd
commit
b796e83f81
2 changed files with 9 additions and 1 deletions
|
|
@ -12,6 +12,14 @@ from gases import *
|
|||
from set import set
|
||||
from importFromFile import *
|
||||
|
||||
import os as _os
|
||||
import sys as _sys
|
||||
|
||||
if not os.getenv('PYTHON_CMD'):
|
||||
# Setting PYTHON_CMD here avoids issues with .cti -> .xml conversions
|
||||
# in cases where the python interpreter isn't in the system path.
|
||||
os.environ['PYTHON_CMD'] = _sys.executable
|
||||
|
||||
def writeCSV(f, list):
|
||||
"""
|
||||
Write list items to file 'f' in
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ namespace ctml {
|
|||
if (!py) {
|
||||
const char* hm = getenv("HOME");
|
||||
string home = stripws(string(hm));
|
||||
string cmd = string("source ")+home
|
||||
string cmd = string(". ")+home
|
||||
+string("/setup_cantera &> /dev/null");
|
||||
system(cmd.c_str());
|
||||
py = getenv("PYTHON_CMD");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue