summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/PythonUtil.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2012-05-10 16:45:22 -0700
committerMark Spruiell <mes@zeroc.com>2012-05-10 16:45:22 -0700
commit485691562a75595eda00af35f5235f6fc22fa36c (patch)
tree4eaf48ac7512239a47d97e533cd3da1a75084f29 /cpp/src/Slice/PythonUtil.cpp
parent* C++ implementation for compact/sliced formats (diff)
downloadice-485691562a75595eda00af35f5235f6fc22fa36c.tar.bz2
ice-485691562a75595eda00af35f5235f6fc22fa36c.tar.xz
ice-485691562a75595eda00af35f5235f6fc22fa36c.zip
C++ bug fixes; adding more Python tests
Diffstat (limited to 'cpp/src/Slice/PythonUtil.cpp')
-rwxr-xr-xcpp/src/Slice/PythonUtil.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/cpp/src/Slice/PythonUtil.cpp b/cpp/src/Slice/PythonUtil.cpp
index fada4154502..4e363c17d18 100755
--- a/cpp/src/Slice/PythonUtil.cpp
+++ b/cpp/src/Slice/PythonUtil.cpp
@@ -796,8 +796,8 @@ Slice::Python::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
DataMemberList members = p->dataMembers();
_out << sp << nl << "_M_" << type << " = IcePy.defineClass('" << scoped << "', " << name << ", ";
writeMetaData(p->getMetaData());
- _out << ", " << (isAbstract ? "True" : "False") << ", " << (p->hasMetaData("preserve-slice") ? "True" : "False")
- << ", ";
+ const bool preserved = p->hasMetaData("preserve-slice") || p->inheritsMetaData("preserve-slice");
+ _out << ", " << (isAbstract ? "True" : "False") << ", " << (preserved ? "True" : "False") << ", ";
if(!base)
{
_out << "None";
@@ -1106,7 +1106,8 @@ Slice::Python::CodeVisitor::visitExceptionStart(const ExceptionPtr& p)
string type = getAbsolute(p, "_t_");
_out << sp << nl << "_M_" << type << " = IcePy.defineException('" << scoped << "', " << name << ", ";
writeMetaData(p->getMetaData());
- _out << ", " << (p->hasMetaData("preserve-slice") ? "True" : "False") << ", ";
+ const bool preserved = p->hasMetaData("preserve-slice") || p->inheritsMetaData("preserve-slice");
+ _out << ", " << (preserved ? "True" : "False") << ", ";
if(!base)
{
_out << "None";