prepare for PyCXX 7.0

This commit is contained in:
wmayer
2018-04-18 19:20:50 +02:00
parent c4aaef4033
commit 840c9e8b3c
36 changed files with 226 additions and 239 deletions

View File

@@ -51,6 +51,11 @@
#include <typeinfo>
#include "Exception.h"
#if PY_MAJOR_VERSION > 2
# ifndef PYCXX_PYTHON_2TO3
# define PYCXX_PYTHON_2TO3
# endif
#endif
#include <CXX/Objects.hxx>

View File

@@ -367,7 +367,7 @@ Py::Object ProgressIndicatorPy::next(const Py::Tuple& args)
}
catch (const Base::AbortException&) {
_seq.reset();
throw Py::Exception("abort progress indicator");
throw Py::RuntimeError("abort progress indicator");
}
}
return Py::None();

View File

@@ -613,7 +613,7 @@ void VectorPy::setLength(Py::Float arg)
VectorPy::PointerType ptr = reinterpret_cast<VectorPy::PointerType>(_pcTwinPointer);
double len = ptr->Length();
if (len < 1.0e-6) {
throw Py::Exception(std::string("Cannot set length of null vector"));
throw Py::RuntimeError(std::string("Cannot set length of null vector"));
}
double val = (double)arg/len;