summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/PythonUtil.cpp
diff options
context:
space:
mode:
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";