From b5e2c394907b6e5c69d2a2907aeae3a6ede59905 Mon Sep 17 00:00:00 2001 From: Mark Spruiell Date: Tue, 7 Apr 2009 17:23:19 -0700 Subject: bug 3739 - generate concrete Python/Ruby class for Slice class that inherits no operations from interface --- cpp/src/Slice/PythonUtil.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'cpp/src/Slice/PythonUtil.cpp') 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"; -- cgit v1.2.3