diff --git a/src/App/Application.cpp b/src/App/Application.cpp index 06ee164ac8bc..868235fc0f44 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -187,15 +187,6 @@ Application::Application(ParameterManager * /*pcSysParamMngr*/, // introducing additional classes - // 0001368: Subclassing Matrix silently fails - // Remove the Py_TPFLAGS_BASETYPE flag to disallow subclasses - Base::VectorPy::Type.tp_flags &= ~Py_TPFLAGS_BASETYPE; - Base::MatrixPy::Type.tp_flags &= ~Py_TPFLAGS_BASETYPE; - Base::BoundBoxPy::Type.tp_flags &= ~Py_TPFLAGS_BASETYPE; - Base::PlacementPy::Type.tp_flags &= ~Py_TPFLAGS_BASETYPE; - Base::RotationPy::Type.tp_flags &= ~Py_TPFLAGS_BASETYPE; - Base::AxisPy::Type.tp_flags &= ~Py_TPFLAGS_BASETYPE; - // NOTE: To finish the initialization of our own type objects we must // call PyType_Ready, otherwise we run into a segmentation fault, later on. // This function is responsible for adding inherited slots from a type's base class. diff --git a/src/Tools/generateTemplates/templateClassPyExport.py b/src/Tools/generateTemplates/templateClassPyExport.py index b1b6d39ede7d..e3f0e0b67dc9 100644 --- a/src/Tools/generateTemplates/templateClassPyExport.py +++ b/src/Tools/generateTemplates/templateClassPyExport.py @@ -272,13 +272,13 @@ class @self.export.Namespace@Export @self.export.Name@ : public @self.export.Fat 0, /* tp_as_buffer */ /* --- Flags to define presence of optional/expanded features */ + if (self.export.RichCompare and self.export.NumberProtocol): - Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_CLASS|Py_TPFLAGS_HAVE_RICHCOMPARE|Py_TPFLAGS_CHECKTYPES, /*tp_flags */ + Py_TPFLAGS_HAVE_CLASS|Py_TPFLAGS_HAVE_RICHCOMPARE|Py_TPFLAGS_CHECKTYPES, /*tp_flags */ = elif (self.export.RichCompare): - Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_CLASS|Py_TPFLAGS_HAVE_RICHCOMPARE, /*tp_flags */ + Py_TPFLAGS_HAVE_CLASS|Py_TPFLAGS_HAVE_RICHCOMPARE, /*tp_flags */ = elif (self.export.NumberProtocol): - Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_CLASS|Py_TPFLAGS_CHECKTYPES, /*tp_flags */ + Py_TPFLAGS_HAVE_CLASS|Py_TPFLAGS_CHECKTYPES, /*tp_flags */ = else: - Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_CLASS, /*tp_flags */ + Py_TPFLAGS_HAVE_CLASS, /*tp_flags */ - "@self.export.Documentation.UserDocu.replace('\\n','\\\\n\\"\\n \\"')@", /*tp_doc */ 0, /*tp_traverse */