diff options
author | Mark Spruiell <mes@zeroc.com> | 2016-12-09 15:18:08 -0800 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2016-12-09 15:18:08 -0800 |
commit | 3b7e9f99b61538e0bbd6f07deeb7f7cb12013ed5 (patch) | |
tree | a8edbf5d1043527cc50880b34ee83458ed7e4855 /python/modules/IcePy/Slice.cpp | |
parent | Merge remote-tracking branch 'origin/3.6' (diff) | |
download | ice-3b7e9f99b61538e0bbd6f07deeb7f7cb12013ed5.tar.bz2 ice-3b7e9f99b61538e0bbd6f07deeb7f7cb12013ed5.tar.xz ice-3b7e9f99b61538e0bbd6f07deeb7f7cb12013ed5.zip |
ICE-7138 - new Python AMI mapping based on futures and modified AMD mapping
Diffstat (limited to 'python/modules/IcePy/Slice.cpp')
-rw-r--r-- | python/modules/IcePy/Slice.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/python/modules/IcePy/Slice.cpp b/python/modules/IcePy/Slice.cpp index 1294a80194c..4581a97f45b 100644 --- a/python/modules/IcePy/Slice.cpp +++ b/python/modules/IcePy/Slice.cpp @@ -72,6 +72,7 @@ IcePy_loadSlice(PyObject* /*self*/, PyObject* args) opts.addOpt("", "underscore"); opts.addOpt("", "checksum"); opts.addOpt("", "all"); + opts.addOpt("", "python3"); vector<string> files; try @@ -102,6 +103,7 @@ IcePy_loadSlice(PyObject* /*self*/, PyObject* args) bool underscore = opts.isSet("underscore"); bool all = false; bool checksum = false; + bool python3 = false; if(opts.isSet("D")) { vector<string> optargs = opts.argVec("D"); @@ -129,6 +131,7 @@ IcePy_loadSlice(PyObject* /*self*/, PyObject* args) debug = opts.isSet("d") || opts.isSet("debug"); all = opts.isSet("all"); checksum = opts.isSet("checksum"); + python3 = opts.isSet("python3"); bool ignoreRedefs = false; bool keepComments = true; @@ -161,11 +164,13 @@ 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); + generate(u, all, checksum, python3, includePaths, out); u->destroy(); string code = codeStream.str(); |