diff options
Diffstat (limited to 'python/modules/IcePy/Slice.cpp')
-rw-r--r-- | python/modules/IcePy/Slice.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/python/modules/IcePy/Slice.cpp b/python/modules/IcePy/Slice.cpp index ed1e4155758..b87d7970d4a 100644 --- a/python/modules/IcePy/Slice.cpp +++ b/python/modules/IcePy/Slice.cpp @@ -16,6 +16,7 @@ #include <Slice/PythonUtil.h> #include <Slice/Util.h> #include <IceUtil/Options.h> +#include <IceUtil/ConsoleUtil.h> // // Python headers needed for PyEval_EvalCode. @@ -27,6 +28,7 @@ using namespace std; using namespace IcePy; using namespace Slice; using namespace Slice::Python; +using namespace IceUtilInternal; extern "C" PyObject* @@ -161,8 +163,10 @@ IcePy_loadSlice(PyObject* /*self*/, PyObject* args) ostringstream codeStream; IceUtilInternal::Output out(codeStream); out.setUseTab(false); + // - // Python magic comment to set the file encoding, it must be first or second line + // Emit a Python magic comment to set the file encoding. + // It must be the first or second line. // out << "# -*- coding: utf-8 -*-\n"; generate(u, all, checksum, includePaths, out); @@ -231,22 +235,22 @@ IcePy_compile(PyObject* /*self*/, PyObject* args) } catch(const std::exception& ex) { - getErrorStream() << argSeq[0] << ": error:" << ex.what() << endl; + consoleErr << argSeq[0] << ": error:" << ex.what() << endl; rc = EXIT_FAILURE; } catch(const std::string& msg) { - getErrorStream() << argSeq[0] << ": error:" << msg << endl; + consoleErr << argSeq[0] << ": error:" << msg << endl; rc = EXIT_FAILURE; } catch(const char* msg) { - getErrorStream() << argSeq[0] << ": error:" << msg << endl; + consoleErr << argSeq[0] << ": error:" << msg << endl; rc = EXIT_FAILURE; } catch(...) { - getErrorStream() << argSeq[0] << ": error:" << "unknown exception" << endl; + consoleErr << argSeq[0] << ": error:" << "unknown exception" << endl; rc = EXIT_FAILURE; } |