Skip to content

Commit

Permalink
+ fixes #1368: Subclassing Matrix silently fails
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Oct 12, 2015
1 parent aac2b26 commit 706d159
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/App/Application.cpp
Expand Up @@ -187,6 +187,15 @@ 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.
Expand Down

0 comments on commit 706d159

Please sign in to comment.