Base: raise TypeError if Vector is multiplied with unsupported type

This commit is contained in:
wmayer
2022-06-04 13:21:04 +02:00
parent 7d1a5b1d6a
commit e3c384263c
2 changed files with 6 additions and 3 deletions

View File

@@ -32,8 +32,6 @@
// inclusion of the generated files (generated out of VectorPy.xml)
#include "GeometryPyCXX.h"
#include "VectorPy.h"
#include "MatrixPy.h"
#include "RotationPy.h"
#include "VectorPy.cpp"
using namespace Base;
@@ -156,7 +154,7 @@ PyObject* VectorPy::number_multiply_handler(PyObject *self, PyObject *other)
return new VectorPy(a * b);
}
else {
PyErr_SetString(PyExc_NotImplementedError, "Not implemented");
PyErr_SetString(PyExc_TypeError, "A Vector can only be multiplied by Vector or number");
return nullptr;
}
}