Base: fix possible Python type mismatch for Base::Vector2dPy

when using FreeCAD as a pure Python module.

See forum topic: https://forum.freecadweb.org/viewtopic.php?f=10&t=67617
This commit is contained in:
wmayer
2022-03-31 15:08:48 +02:00
parent 19feabd072
commit f62a6c8658
2 changed files with 19 additions and 0 deletions

View File

@@ -91,6 +91,21 @@ Base::Vector3d Py::Vector::toVector() const
namespace Base {
Py::PythonType& Vector2dPy::behaviors()
{
return Py::PythonClass<Vector2dPy>::behaviors();
}
PyTypeObject* Vector2dPy::type_object()
{
return Py::PythonClass<Vector2dPy>::type_object();
}
bool Vector2dPy::check( PyObject *p )
{
return Py::PythonClass<Vector2dPy>::check(p);
}
Py::PythonClassObject<Vector2dPy> Vector2dPy::create(const Vector2d& v)
{
return create(v.x, v.y);