From 9a8dbf75f87a8b870d474c294851b86fc156d792 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Mon, 29 Jul 2013 01:37:54 +0000 Subject: [PATCH] CTI to XML conversion works with either new or old Python module --- src/base/ct2ctml.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/base/ct2ctml.cpp b/src/base/ct2ctml.cpp index 1cad4f799..73b1c32ac 100644 --- a/src/base/ct2ctml.cpp +++ b/src/base/ct2ctml.cpp @@ -75,7 +75,10 @@ void ct2ctml(const char* file, const int debug) "if True:\n" << // Use this so that the rest is a single block " import sys\n" << " sys.stderr = sys.stdout\n" << - " import ctml_writer\n" << + " try:\n" << + " from cantera import ctml_writer\n" << + " except ImportError:\n" << + " import ctml_writer\n" << " ctml_writer.convert(r'" << file << "')\n" << " sys.exit(0)\n\n" "sys.exit(7)\n";