diff options
author | Mark Spruiell <mes@zeroc.com> | 2009-04-07 17:23:19 -0700 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2009-04-07 17:23:19 -0700 |
commit | b5e2c394907b6e5c69d2a2907aeae3a6ede59905 (patch) | |
tree | 52b51ec2d803153e6002a867ac064e6195e1a51c /cpp/src/Slice/PythonUtil.cpp | |
parent | updating CHANGES for bug 849 (diff) | |
download | ice-b5e2c394907b6e5c69d2a2907aeae3a6ede59905.tar.bz2 ice-b5e2c394907b6e5c69d2a2907aeae3a6ede59905.tar.xz ice-b5e2c394907b6e5c69d2a2907aeae3a6ede59905.zip |
bug 3739 - generate concrete Python/Ruby class for Slice class that inherits no operations from interface
Diffstat (limited to 'cpp/src/Slice/PythonUtil.cpp')
-rw-r--r-- | cpp/src/Slice/PythonUtil.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cpp/src/Slice/PythonUtil.cpp b/cpp/src/Slice/PythonUtil.cpp index 34fb3bd9654..08a1366c68a 100644 --- a/cpp/src/Slice/PythonUtil.cpp +++ b/cpp/src/Slice/PythonUtil.cpp @@ -394,6 +394,7 @@ Slice::Python::CodeVisitor::visitClassDefStart(const ClassDefPtr& p) ClassDefPtr base; OperationList ops = p->operations(); OperationList::iterator oli; + bool isAbstract = p->isInterface() || p->allOperations().size() > 0; // Don't use isAbstract() - see bug 3739 // // Define the class. @@ -448,13 +449,13 @@ Slice::Python::CodeVisitor::visitClassDefStart(const ClassDefPtr& p) } _out << "):"; _out.inc(); - if(!base && !p->hasDataMembers() && !p->isAbstract()) + if(!base && !p->hasDataMembers() && !isAbstract) { _out << nl << "pass"; } else { - if(p->isAbstract()) + if(isAbstract) { _out << nl << "if __builtin__.type(self) == _M_" << abs << ':'; _out.inc(); @@ -715,7 +716,7 @@ Slice::Python::CodeVisitor::visitClassDefStart(const ClassDefPtr& p) DataMemberList members = p->dataMembers(); _out << sp << nl << "_M_" << type << " = IcePy.defineClass('" << scoped << "', " << name << ", "; writeMetaData(p->getMetaData()); - _out << ", " << (p->isAbstract() ? "True" : "False") << ", "; + _out << ", " << (isAbstract ? "True" : "False") << ", "; if(!base) { _out << "None"; |