From 23415dbe550257ac47342f79819c7f4dc16df1af Mon Sep 17 00:00:00 2001 From: Harry Moffat Date: Fri, 28 Dec 2007 02:16:09 +0000 Subject: [PATCH] Changed the pypath() routine to reflect its own documentation. If it fails to find PYTHON_CMD in the environment, it will now return the string python, and not throw an error. WIth this change PYTHON_CMD doesn't have to be set in the user's environment. Instead Cantera will fall back to using the user's default path to find the executable, python. --- Cantera/src/base/ct2ctml.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/Cantera/src/base/ct2ctml.cpp b/Cantera/src/base/ct2ctml.cpp index c3e2b92b0..fd29974bf 100644 --- a/Cantera/src/base/ct2ctml.cpp +++ b/Cantera/src/base/ct2ctml.cpp @@ -1,6 +1,9 @@ /** * @file ct2ctml.cpp - * + * Driver for the system call to the python executable that converts + * cti files to ctml files (see \ref inputfiles). + */ +/* * $Author$ * $Revision$ * $Date$ @@ -30,11 +33,13 @@ using namespace Cantera; namespace ctml { - // return the full path to the Python interpreter. Use - // environment variable PYTHON_CMD if it is set. If not, return - // the string 'python'. + //! return the full path to the Python interpreter. + /*! + * Use the environment variable PYTHON_CMD if it is set. If not, return + * the string 'python'. + */ static string pypath() { - string s = "ctpython"; + string s = "python"; const char* py = getenv("PYTHON_CMD"); if (!py) { const char* hm = getenv("HOME"); @@ -50,10 +55,10 @@ namespace ctml { s = sp; } } - else { - throw CanteraError("ct2ctml", - "set environment variable PYTHON_CMD"); - } + //else { + // throw CanteraError("ct2ctml", + // "set environment variable PYTHON_CMD"); + //} return s; }