|
|
f5ca97c |
From 840c9e8b3c0cab7d38d410b785b140306be4e5e4 Mon Sep 17 00:00:00 2001
|
|
|
f5ca97c |
From: wmayer <wmayer@users.sourceforge.net>
|
|
|
f5ca97c |
Date: Wed, 18 Apr 2018 19:20:50 +0200
|
|
|
f5ca97c |
Subject: [PATCH] prepare for PyCXX 7.0
|
|
|
f5ca97c |
|
|
|
f5ca97c |
---
|
|
|
f5ca97c |
src/Base/PyObjectBase.h | 5 +
|
|
|
f5ca97c |
src/Base/Sequencer.cpp | 2 +-
|
|
|
f5ca97c |
src/Base/VectorPyImp.cpp | 2 +-
|
|
|
f5ca97c |
src/Gui/SplitView3DInventor.cpp | 56 +++----
|
|
|
f5ca97c |
src/Gui/TaskView/TaskDialogPython.cpp | 2 +-
|
|
|
f5ca97c |
src/Gui/View3DPy.cpp | 202 ++++++++++++-------------
|
|
|
f5ca97c |
src/Gui/View3DViewerPy.cpp | 34 ++---
|
|
|
f5ca97c |
src/Gui/ViewProviderPyImp.cpp | 4 +-
|
|
|
f5ca97c |
src/Gui/WidgetFactory.cpp | 2 +-
|
|
|
f5ca97c |
src/Mod/Part/App/AppPartPy.cpp | 2 +-
|
|
|
f5ca97c |
src/Mod/Part/App/ArcOfConicPyImp.cpp | 6 +-
|
|
|
f5ca97c |
src/Mod/Part/App/ConePyImp.cpp | 2 +-
|
|
|
f5ca97c |
src/Mod/Part/App/ConicPyImp.cpp | 6 +-
|
|
|
f5ca97c |
src/Mod/Part/App/CylinderPyImp.cpp | 2 +-
|
|
|
f5ca97c |
src/Mod/Part/App/Geom2d/Line2dPyImp.cpp | 10 +-
|
|
|
f5ca97c |
src/Mod/Part/App/Geom2d/Line2dSegmentPyImp.cpp | 10 +-
|
|
|
f5ca97c |
src/Mod/Part/App/Geom2d/OffsetCurve2dPyImp.cpp | 3 +-
|
|
|
f5ca97c |
src/Mod/Part/App/LinePyImp.cpp | 10 +-
|
|
|
f5ca97c |
src/Mod/Part/App/LineSegmentPyImp.cpp | 11 +-
|
|
|
f5ca97c |
src/Mod/Part/App/OffsetCurvePyImp.cpp | 3 +-
|
|
|
f5ca97c |
src/Mod/Part/App/OffsetSurfacePyImp.cpp | 3 +-
|
|
|
f5ca97c |
src/Mod/Part/App/PlanePyImp.cpp | 5 +-
|
|
|
f5ca97c |
src/Mod/Part/App/PointPyImp.cpp | 9 +-
|
|
|
f5ca97c |
src/Mod/Part/App/SpherePyImp.cpp | 2 +-
|
|
|
f5ca97c |
src/Mod/Part/App/SurfaceOfExtrusionPyImp.cpp | 3 +-
|
|
|
f5ca97c |
src/Mod/Part/App/SurfaceOfRevolutionPyImp.cpp | 3 +-
|
|
|
f5ca97c |
src/Mod/Part/App/TopoShapeEdgePyImp.cpp | 2 +-
|
|
|
f5ca97c |
src/Mod/Part/App/TopoShapeFacePyImp.cpp | 4 +-
|
|
|
f5ca97c |
src/Mod/Part/App/ToroidPyImp.cpp | 6 +-
|
|
|
f5ca97c |
src/Mod/Path/App/CommandPyImp.cpp | 12 +-
|
|
|
f5ca97c |
src/Mod/Path/App/PathPyImp.cpp | 8 +-
|
|
|
f5ca97c |
src/Mod/Path/App/TooltablePyImp.cpp | 12 +-
|
|
|
f5ca97c |
src/Mod/Sandbox/App/DocumentProtectorPy.cpp | 6 +-
|
|
|
f5ca97c |
src/Mod/TechDraw/App/AppTechDrawPy.cpp | 10 +-
|
|
|
f5ca97c |
src/Mod/TechDraw/App/DrawViewSymbolPyImp.cpp | 2 +-
|
|
|
f5ca97c |
src/Mod/TechDraw/Gui/AppTechDrawGuiPy.cpp | 4 +-
|
|
|
f5ca97c |
36 files changed, 226 insertions(+), 239 deletions(-)
|
|
|
f5ca97c |
|
|
|
f5ca97c |
diff --git a/src/Base/PyObjectBase.h b/src/Base/PyObjectBase.h
|
|
|
f5ca97c |
index ae9724ac47..680623b103 100644
|
|
|
f5ca97c |
--- a/src/Base/PyObjectBase.h
|
|
|
f5ca97c |
+++ b/src/Base/PyObjectBase.h
|
|
|
f5ca97c |
@@ -51,6 +51,11 @@
|
|
|
f5ca97c |
|
|
|
f5ca97c |
#include <typeinfo>
|
|
|
f5ca97c |
#include "Exception.h"
|
|
|
f5ca97c |
+#if PY_MAJOR_VERSION > 2
|
|
|
f5ca97c |
+# ifndef PYCXX_PYTHON_2TO3
|
|
|
f5ca97c |
+# define PYCXX_PYTHON_2TO3
|
|
|
f5ca97c |
+# endif
|
|
|
f5ca97c |
+#endif
|
|
|
f5ca97c |
#include <CXX/Objects.hxx>
|
|
|
f5ca97c |
|
|
|
f5ca97c |
|
|
|
f5ca97c |
diff --git a/src/Base/Sequencer.cpp b/src/Base/Sequencer.cpp
|
|
|
f5ca97c |
index 8b9fd9ff78..39888b8832 100644
|
|
|
f5ca97c |
--- a/src/Base/Sequencer.cpp
|
|
|
f5ca97c |
+++ b/src/Base/Sequencer.cpp
|
|
|
f5ca97c |
@@ -367,7 +367,7 @@ Py::Object ProgressIndicatorPy::next(const Py::Tuple& args)
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::AbortException&) {
|
|
|
f5ca97c |
_seq.reset();
|
|
|
f5ca97c |
- throw Py::Exception("abort progress indicator");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("abort progress indicator");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
return Py::None();
|
|
|
f5ca97c |
diff --git a/src/Base/VectorPyImp.cpp b/src/Base/VectorPyImp.cpp
|
|
|
f5ca97c |
index ae2e915bab..6a862e46d4 100644
|
|
|
f5ca97c |
--- a/src/Base/VectorPyImp.cpp
|
|
|
f5ca97c |
+++ b/src/Base/VectorPyImp.cpp
|
|
|
f5ca97c |
@@ -613,7 +613,7 @@ void VectorPy::setLength(Py::Float arg)
|
|
|
f5ca97c |
VectorPy::PointerType ptr = reinterpret_cast<VectorPy::PointerType>(_pcTwinPointer);
|
|
|
f5ca97c |
double len = ptr->Length();
|
|
|
f5ca97c |
if (len < 1.0e-6) {
|
|
|
f5ca97c |
- throw Py::Exception(std::string("Cannot set length of null vector"));
|
|
|
f5ca97c |
+ throw Py::RuntimeError(std::string("Cannot set length of null vector"));
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
double val = (double)arg/len;
|
|
|
f5ca97c |
diff --git a/src/Gui/SplitView3DInventor.cpp b/src/Gui/SplitView3DInventor.cpp
|
|
|
f5ca97c |
index 6f4d5c713b..e16e19f534 100644
|
|
|
f5ca97c |
--- a/src/Gui/SplitView3DInventor.cpp
|
|
|
f5ca97c |
+++ b/src/Gui/SplitView3DInventor.cpp
|
|
|
f5ca97c |
@@ -450,7 +450,7 @@ AbstractSplitViewPy::~AbstractSplitViewPy()
|
|
|
f5ca97c |
void AbstractSplitViewPy::testExistence()
|
|
|
f5ca97c |
{
|
|
|
f5ca97c |
if (!(_view && _view->getViewer(0)))
|
|
|
f5ca97c |
- throw Py::Exception("Object already deleted");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Object already deleted");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
Py::Object AbstractSplitViewPy::repr()
|
|
|
f5ca97c |
@@ -473,13 +473,13 @@ Py::Object AbstractSplitViewPy::fitAll(const Py::Tuple& args)
|
|
|
f5ca97c |
_view->onMsg("ViewFit", 0);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
return Py::None();
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
@@ -494,13 +494,13 @@ Py::Object AbstractSplitViewPy::viewBottom(const Py::Tuple& args)
|
|
|
f5ca97c |
_view->onMsg("ViewBottom", 0);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
return Py::None();
|
|
|
f5ca97c |
@@ -516,13 +516,13 @@ Py::Object AbstractSplitViewPy::viewFront(const Py::Tuple& args)
|
|
|
f5ca97c |
_view->onMsg("ViewFront", 0);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
return Py::None();
|
|
|
f5ca97c |
@@ -538,13 +538,13 @@ Py::Object AbstractSplitViewPy::viewLeft(const Py::Tuple& args)
|
|
|
f5ca97c |
_view->onMsg("ViewLeft", 0);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
return Py::None();
|
|
|
f5ca97c |
@@ -560,13 +560,13 @@ Py::Object AbstractSplitViewPy::viewRear(const Py::Tuple& args)
|
|
|
f5ca97c |
_view->onMsg("ViewRear", 0);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
return Py::None();
|
|
|
f5ca97c |
@@ -582,13 +582,13 @@ Py::Object AbstractSplitViewPy::viewRight(const Py::Tuple& args)
|
|
|
f5ca97c |
_view->onMsg("ViewRight", 0);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
return Py::None();
|
|
|
f5ca97c |
@@ -604,13 +604,13 @@ Py::Object AbstractSplitViewPy::viewTop(const Py::Tuple& args)
|
|
|
f5ca97c |
_view->onMsg("ViewTop", 0);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
return Py::None();
|
|
|
f5ca97c |
@@ -626,13 +626,13 @@ Py::Object AbstractSplitViewPy::viewAxometric(const Py::Tuple& args)
|
|
|
f5ca97c |
_view->onMsg("ViewAxo", 0);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
return Py::None();
|
|
|
f5ca97c |
@@ -652,13 +652,13 @@ Py::Object AbstractSplitViewPy::getViewer(const Py::Tuple& args)
|
|
|
f5ca97c |
return Py::Object(view->getPyObject());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
diff --git a/src/Gui/TaskView/TaskDialogPython.cpp b/src/Gui/TaskView/TaskDialogPython.cpp
|
|
|
f5ca97c |
index bbafe006c4..9ff860cf84 100644
|
|
|
f5ca97c |
--- a/src/Gui/TaskView/TaskDialogPython.cpp
|
|
|
f5ca97c |
+++ b/src/Gui/TaskView/TaskDialogPython.cpp
|
|
|
f5ca97c |
@@ -92,7 +92,7 @@ Py::Object ControlPy::showDialog(const Py::Tuple& args)
|
|
|
f5ca97c |
{
|
|
|
f5ca97c |
Gui::TaskView::TaskDialog* act = Gui::Control().activeDialog();
|
|
|
f5ca97c |
if (act)
|
|
|
f5ca97c |
- throw Py::Exception("Active task dialog found");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Active task dialog found");
|
|
|
f5ca97c |
TaskDialogPython* dlg = new TaskDialogPython(args[0]);
|
|
|
f5ca97c |
Gui::Control().showDialog(dlg);
|
|
|
f5ca97c |
return Py::None();
|
|
|
f5ca97c |
diff --git a/src/Gui/View3DPy.cpp b/src/Gui/View3DPy.cpp
|
|
|
f5ca97c |
index 6de9bfb1de..0b89e747d2 100644
|
|
|
f5ca97c |
--- a/src/Gui/View3DPy.cpp
|
|
|
f5ca97c |
+++ b/src/Gui/View3DPy.cpp
|
|
|
f5ca97c |
@@ -211,13 +211,13 @@ PyObject *View3DInventorPy::method_varargs_ext_handler(PyObject *_self_and_name_
|
|
|
f5ca97c |
return pycxx_handler(_self_and_name_tuple, _args);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
@@ -275,13 +275,13 @@ Py::Object View3DInventorPy::message(const Py::Tuple& args)
|
|
|
f5ca97c |
_view->onMsg(psMsgStr,ppReturn);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
return Py::None();
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
@@ -296,13 +296,13 @@ Py::Object View3DInventorPy::fitAll(const Py::Tuple& args)
|
|
|
f5ca97c |
_view->getViewer()->viewAll((float)factor);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
return Py::None();
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
@@ -329,13 +329,13 @@ Py::Object View3DInventorPy::viewBottom(const Py::Tuple& args)
|
|
|
f5ca97c |
_view->getViewer()->setCameraOrientation(SbRotation(0, -1, 0, 0));
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
return Py::None();
|
|
|
f5ca97c |
@@ -351,13 +351,13 @@ Py::Object View3DInventorPy::viewFront(const Py::Tuple& args)
|
|
|
f5ca97c |
_view->getViewer()->setCameraOrientation(SbRotation(-root, 0, 0, -root));
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
return Py::None();
|
|
|
f5ca97c |
@@ -372,13 +372,13 @@ Py::Object View3DInventorPy::viewLeft(const Py::Tuple& args)
|
|
|
f5ca97c |
_view->getViewer()->setCameraOrientation(SbRotation(-0.5, 0.5, 0.5, -0.5));
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
return Py::None();
|
|
|
f5ca97c |
@@ -394,13 +394,13 @@ Py::Object View3DInventorPy::viewRear(const Py::Tuple& args)
|
|
|
f5ca97c |
_view->getViewer()->setCameraOrientation(SbRotation(0, root, root, 0));
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
return Py::None();
|
|
|
f5ca97c |
@@ -415,13 +415,13 @@ Py::Object View3DInventorPy::viewRight(const Py::Tuple& args)
|
|
|
f5ca97c |
_view->getViewer()->setCameraOrientation(SbRotation(0.5, 0.5, 0.5, 0.5));
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
return Py::None();
|
|
|
f5ca97c |
@@ -436,13 +436,13 @@ Py::Object View3DInventorPy::viewTop(const Py::Tuple& args)
|
|
|
f5ca97c |
_view->getViewer()->setCameraOrientation(SbRotation(0, 0, 0, 1));
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
return Py::None();
|
|
|
f5ca97c |
@@ -471,13 +471,13 @@ Py::Object View3DInventorPy::viewAxonometric(const Py::Tuple& args)
|
|
|
f5ca97c |
(0.424708f, 0.17592f, 0.339851f, 0.820473f));
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
return Py::None();
|
|
|
f5ca97c |
@@ -497,13 +497,13 @@ Py::Object View3DInventorPy::viewRotateLeft(const Py::Tuple& args)
|
|
|
f5ca97c |
cam->orientation.setValue(rot*nrot);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
return Py::None();
|
|
|
f5ca97c |
@@ -523,13 +523,13 @@ Py::Object View3DInventorPy::viewRotateRight(const Py::Tuple& args)
|
|
|
f5ca97c |
cam->orientation.setValue(rot*nrot);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
return Py::None();
|
|
|
f5ca97c |
@@ -544,13 +544,13 @@ Py::Object View3DInventorPy::zoomIn(const Py::Tuple& args)
|
|
|
f5ca97c |
_view->getViewer()->navigationStyle()->zoomIn();
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
return Py::None();
|
|
|
f5ca97c |
@@ -565,13 +565,13 @@ Py::Object View3DInventorPy::zoomOut(const Py::Tuple& args)
|
|
|
f5ca97c |
_view->getViewer()->navigationStyle()->zoomOut();
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
return Py::None();
|
|
|
f5ca97c |
@@ -607,13 +607,13 @@ Py::Object View3DInventorPy::setCameraOrientation(const Py::Tuple& args)
|
|
|
f5ca97c |
throw; // re-throw
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
return Py::None();
|
|
|
f5ca97c |
@@ -750,14 +750,14 @@ Py::Object View3DInventorPy::saveVectorGraphic(const Py::Tuple& args)
|
|
|
f5ca97c |
vo = std::unique_ptr<SoVectorizeAction>(new SoFCVectorizeU3DAction());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
else {
|
|
|
f5ca97c |
- throw Py::Exception("Not supported vector graphic");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Not supported vector graphic");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
SoVectorOutput * out = vo->getOutput();
|
|
|
f5ca97c |
if (!out || !out->openFile(filename)) {
|
|
|
f5ca97c |
std::ostringstream a_out;
|
|
|
f5ca97c |
a_out << "Cannot open file '" << filename << "'";
|
|
|
f5ca97c |
- throw Py::Exception(a_out.str());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(a_out.str());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
QColor bg;
|
|
|
f5ca97c |
@@ -789,7 +789,7 @@ Py::Object View3DInventorPy::getCameraNode(const Py::Tuple& args)
|
|
|
f5ca97c |
return Py::Object(proxy, true);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
@@ -810,13 +810,13 @@ Py::Object View3DInventorPy::getCamera(const Py::Tuple& args)
|
|
|
f5ca97c |
return Py::String(buffer);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
@@ -829,13 +829,13 @@ Py::Object View3DInventorPy::getViewDirection(const Py::Tuple& args)
|
|
|
f5ca97c |
return Py::Vector(Base::Vector3f(dvec[0], dvec[1], dvec[2]));
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
@@ -863,13 +863,13 @@ Py::Object View3DInventorPy::setViewDirection(const Py::Tuple& args)
|
|
|
f5ca97c |
throw; // re-throw
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
return Py::None();
|
|
|
f5ca97c |
@@ -888,13 +888,13 @@ Py::Object View3DInventorPy::setCamera(const Py::Tuple& args)
|
|
|
f5ca97c |
return Py::None();
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
@@ -908,7 +908,7 @@ Py::Object View3DInventorPy::getCameraType(const Py::Tuple& args)
|
|
|
f5ca97c |
|
|
|
f5ca97c |
SoCamera* cam = _view->getViewer()->getSoRenderManager()->getCamera();
|
|
|
f5ca97c |
if (!cam) {
|
|
|
f5ca97c |
- throw Py::Exception("No camera set!");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("No camera set!");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
else if (cam->getTypeId() == SoOrthographicCamera::getClassTypeId()) {
|
|
|
f5ca97c |
return Py::String(CameraTypeEnums[0]);
|
|
|
f5ca97c |
@@ -917,7 +917,7 @@ Py::Object View3DInventorPy::getCameraType(const Py::Tuple& args)
|
|
|
f5ca97c |
return Py::String(CameraTypeEnums[1]);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
else {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown camera type");
|
|
|
f5ca97c |
+ throw Py::TypeError("Unknown camera type");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
@@ -945,7 +945,7 @@ Py::Object View3DInventorPy::setCameraType(const Py::Tuple& args)
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
if (cameratype < 0 || cameratype > 1)
|
|
|
f5ca97c |
- throw Py::Exception("Out of range");
|
|
|
f5ca97c |
+ throw Py::IndexError("Out of range");
|
|
|
f5ca97c |
if (cameratype==0)
|
|
|
f5ca97c |
_view->getViewer()->setCameraType(SoOrthographicCamera::getClassTypeId());
|
|
|
f5ca97c |
else
|
|
|
f5ca97c |
@@ -966,13 +966,13 @@ Py::Object View3DInventorPy::listCameraTypes(const Py::Tuple& args)
|
|
|
f5ca97c |
return list;
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
@@ -987,13 +987,13 @@ Py::Object View3DInventorPy::dump(const Py::Tuple& args)
|
|
|
f5ca97c |
return Py::None();
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
@@ -1008,7 +1008,7 @@ Py::Object View3DInventorPy::dumpNode(const Py::Tuple& args)
|
|
|
f5ca97c |
Base::Interpreter().convertSWIGPointerObj("pivy.coin", "SoNode *", object, &ptr, 0);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
SoNode* node = reinterpret_cast<SoNode*>(ptr);
|
|
|
f5ca97c |
return Py::String(SoFCDB::writeNodesToString(node));
|
|
|
f5ca97c |
@@ -1042,19 +1042,19 @@ Py::Object View3DInventorPy::setStereoType(const Py::Tuple& args)
|
|
|
f5ca97c |
|
|
|
f5ca97c |
try {
|
|
|
f5ca97c |
if (stereomode < 0 || stereomode > 4)
|
|
|
f5ca97c |
- throw Py::Exception("Out of range");
|
|
|
f5ca97c |
+ throw Py::IndexError("Out of range");
|
|
|
f5ca97c |
Quarter::SoQTQuarterAdaptor::StereoMode mode = Quarter::SoQTQuarterAdaptor::StereoMode(stereomode);
|
|
|
f5ca97c |
_view->getViewer()->setStereoMode(mode);
|
|
|
f5ca97c |
return Py::None();
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
@@ -1068,13 +1068,13 @@ Py::Object View3DInventorPy::getStereoType(const Py::Tuple& args)
|
|
|
f5ca97c |
return Py::String(StereoTypeEnums[mode]);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
@@ -1092,13 +1092,13 @@ Py::Object View3DInventorPy::listStereoTypes(const Py::Tuple& args)
|
|
|
f5ca97c |
return list;
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
@@ -1324,7 +1324,7 @@ Py::Object View3DInventorPy::getPoint(const Py::Tuple& args)
|
|
|
f5ca97c |
return Py::Vector(Base::Vector3f(pt[0], pt[1], pt[2]));
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Py::Exception&) {
|
|
|
f5ca97c |
throw;
|
|
|
f5ca97c |
@@ -1344,7 +1344,7 @@ Py::Object View3DInventorPy::getPointOnScreen(const Py::Tuple& args)
|
|
|
f5ca97c |
else {
|
|
|
f5ca97c |
PyErr_Clear();
|
|
|
f5ca97c |
if (!PyArg_ParseTuple(args.ptr(), "ddd", &vx,&vy,&vz)) {
|
|
|
f5ca97c |
- throw Py::Exception("Wrong argument, Vector or three floats expected expected");
|
|
|
f5ca97c |
+ throw Py::TypeError("Wrong argument, Vector or three floats expected expected");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
@@ -1374,7 +1374,7 @@ Py::Object View3DInventorPy::getPointOnScreen(const Py::Tuple& args)
|
|
|
f5ca97c |
return tuple;
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Py::Exception&) {
|
|
|
f5ca97c |
throw;
|
|
|
f5ca97c |
@@ -1771,14 +1771,14 @@ Py::Object View3DInventorPy::addEventCallback(const Py::Tuple& args)
|
|
|
f5ca97c |
throw Py::Exception();
|
|
|
f5ca97c |
try {
|
|
|
f5ca97c |
if (PyCallable_Check(method) == 0) {
|
|
|
f5ca97c |
- throw Py::Exception("object is not callable");
|
|
|
f5ca97c |
+ throw Py::TypeError("object is not callable");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
SoType eventId = SoType::fromName(eventtype);
|
|
|
f5ca97c |
if (eventId.isBad() || !eventId.isDerivedFrom(SoEvent::getClassTypeId())) {
|
|
|
f5ca97c |
std::string s;
|
|
|
f5ca97c |
std::ostringstream s_out;
|
|
|
f5ca97c |
s_out << eventtype << " is not a valid event type";
|
|
|
f5ca97c |
- throw Py::Exception(s_out.str());
|
|
|
f5ca97c |
+ throw Py::TypeError(s_out.str());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
_view->getViewer()->addEventCallback(eventId, View3DInventorPy::eventCallback, method);
|
|
|
f5ca97c |
@@ -1799,14 +1799,14 @@ Py::Object View3DInventorPy::removeEventCallback(const Py::Tuple& args)
|
|
|
f5ca97c |
throw Py::Exception();
|
|
|
f5ca97c |
try {
|
|
|
f5ca97c |
if (PyCallable_Check(method) == 0) {
|
|
|
f5ca97c |
- throw Py::Exception("object is not callable");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("object is not callable");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
SoType eventId = SoType::fromName(eventtype);
|
|
|
f5ca97c |
if (eventId.isBad() || !eventId.isDerivedFrom(SoEvent::getClassTypeId())) {
|
|
|
f5ca97c |
std::string s;
|
|
|
f5ca97c |
std::ostringstream s_out;
|
|
|
f5ca97c |
s_out << eventtype << " is not a valid event type";
|
|
|
f5ca97c |
- throw Py::Exception(s_out.str());
|
|
|
f5ca97c |
+ throw Py::TypeError(s_out.str());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
_view->getViewer()->removeEventCallback(eventId, View3DInventorPy::eventCallback, method);
|
|
|
f5ca97c |
@@ -1831,7 +1831,7 @@ Py::Object View3DInventorPy::setAnnotation(const Py::Tuple& args)
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
delete view;
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
_view->getGuiDocument()->setAnnotationViewProvider(psAnnoName, view);
|
|
|
f5ca97c |
@@ -1870,7 +1870,7 @@ Py::Object View3DInventorPy::getSceneGraph(const Py::Tuple& args)
|
|
|
f5ca97c |
return Py::Object(proxy, true);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
@@ -1964,7 +1964,7 @@ Py::Object View3DInventorPy::addEventCallbackPivy(const Py::Tuple& args)
|
|
|
f5ca97c |
Base::Interpreter().convertSWIGPointerObj("pivy.coin", "SoType *", proxy, &ptr, 0);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
SoType* eventId = reinterpret_cast<SoType*>(ptr);
|
|
|
f5ca97c |
@@ -1972,12 +1972,12 @@ Py::Object View3DInventorPy::addEventCallbackPivy(const Py::Tuple& args)
|
|
|
f5ca97c |
std::string s;
|
|
|
f5ca97c |
std::ostringstream s_out;
|
|
|
f5ca97c |
s_out << eventId->getName().getString() << "is not a valid event type";
|
|
|
f5ca97c |
- throw Py::Exception(s_out.str());
|
|
|
f5ca97c |
+ throw Py::TypeError(s_out.str());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
try {
|
|
|
f5ca97c |
if (PyCallable_Check(method) == 0) {
|
|
|
f5ca97c |
- throw Py::Exception("object is not callable");
|
|
|
f5ca97c |
+ throw Py::TypeError("object is not callable");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
SoEventCallbackCB* callback = (ex == 1 ?
|
|
|
f5ca97c |
@@ -2006,7 +2006,7 @@ Py::Object View3DInventorPy::removeEventCallbackPivy(const Py::Tuple& args)
|
|
|
f5ca97c |
Base::Interpreter().convertSWIGPointerObj("pivy.coin", "SoType *", proxy, &ptr, 0);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
SoType* eventId = reinterpret_cast<SoType*>(ptr);
|
|
|
f5ca97c |
@@ -2014,12 +2014,12 @@ Py::Object View3DInventorPy::removeEventCallbackPivy(const Py::Tuple& args)
|
|
|
f5ca97c |
std::string s;
|
|
|
f5ca97c |
std::ostringstream s_out;
|
|
|
f5ca97c |
s_out << eventId->getName().getString() << "is not a valid event type";
|
|
|
f5ca97c |
- throw Py::Exception(s_out.str());
|
|
|
f5ca97c |
+ throw Py::TypeError(s_out.str());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
try {
|
|
|
f5ca97c |
if (PyCallable_Check(method) == 0) {
|
|
|
f5ca97c |
- throw Py::Exception("object is not callable");
|
|
|
f5ca97c |
+ throw Py::TypeError("object is not callable");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
SoEventCallbackCB* callback = (ex == 1 ?
|
|
|
f5ca97c |
@@ -2066,7 +2066,7 @@ void View3DInventorPy::draggerCallback(void * ud, SoDragger* n)
|
|
|
f5ca97c |
method.apply(args);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Py::Exception& e) {
|
|
|
f5ca97c |
Py::Object o = Py::type(e);
|
|
|
f5ca97c |
@@ -2098,13 +2098,13 @@ Py::Object View3DInventorPy::addDraggerCallback(const Py::Tuple& args)
|
|
|
f5ca97c |
Base::Interpreter().convertSWIGPointerObj("pivy.coin", "SoDragger *", dragger, &ptr, 0);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception&) {
|
|
|
f5ca97c |
- throw Py::Exception("The first argument must be of type SoDragger");
|
|
|
f5ca97c |
+ throw Py::TypeError("The first argument must be of type SoDragger");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
SoDragger* drag = reinterpret_cast<SoDragger*>(ptr);
|
|
|
f5ca97c |
|
|
|
f5ca97c |
//Check if method is callable
|
|
|
f5ca97c |
if (PyCallable_Check(method) == 0) {
|
|
|
f5ca97c |
- throw Py::Exception("the method is not callable");
|
|
|
f5ca97c |
+ throw Py::TypeError("the method is not callable");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
try {
|
|
|
f5ca97c |
@@ -2124,7 +2124,7 @@ Py::Object View3DInventorPy::addDraggerCallback(const Py::Tuple& args)
|
|
|
f5ca97c |
std::string s;
|
|
|
f5ca97c |
std::ostringstream s_out;
|
|
|
f5ca97c |
s_out << type << " is not a valid dragger callback type";
|
|
|
f5ca97c |
- throw Py::Exception(s_out.str());
|
|
|
f5ca97c |
+ throw Py::TypeError(s_out.str());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
callbacks.push_back(method);
|
|
|
f5ca97c |
@@ -2150,7 +2150,7 @@ Py::Object View3DInventorPy::removeDraggerCallback(const Py::Tuple& args)
|
|
|
f5ca97c |
Base::Interpreter().convertSWIGPointerObj("pivy.coin", "SoDragger *", dragger, &ptr, 0);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception&) {
|
|
|
f5ca97c |
- throw Py::Exception("The first argument must be of type SoDragger");
|
|
|
f5ca97c |
+ throw Py::TypeError("The first argument must be of type SoDragger");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
SoDragger* drag = reinterpret_cast<SoDragger*>(ptr);
|
|
|
f5ca97c |
@@ -2171,7 +2171,7 @@ Py::Object View3DInventorPy::removeDraggerCallback(const Py::Tuple& args)
|
|
|
f5ca97c |
std::string s;
|
|
|
f5ca97c |
std::ostringstream s_out;
|
|
|
f5ca97c |
s_out << type << " is not a valid dragger callback type";
|
|
|
f5ca97c |
- throw Py::Exception(s_out.str());
|
|
|
f5ca97c |
+ throw Py::TypeError(s_out.str());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
callbacks.remove(method);
|
|
|
f5ca97c |
diff --git a/src/Gui/View3DViewerPy.cpp b/src/Gui/View3DViewerPy.cpp
|
|
|
f5ca97c |
index 0fea51a2cc..dc5c3d8d43 100644
|
|
|
f5ca97c |
--- a/src/Gui/View3DViewerPy.cpp
|
|
|
f5ca97c |
+++ b/src/Gui/View3DViewerPy.cpp
|
|
|
f5ca97c |
@@ -107,13 +107,13 @@ PyObject *View3DInventorViewerPy::method_varargs_ext_handler(PyObject *_self_and
|
|
|
f5ca97c |
return pycxx_handler(_self_and_name_tuple, _args);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
@@ -162,7 +162,7 @@ Py::Object View3DInventorViewerPy::getSoRenderManager(const Py::Tuple& args)
|
|
|
f5ca97c |
return Py::Object(proxy, true);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
@@ -179,7 +179,7 @@ Py::Object View3DInventorViewerPy::getSceneGraph(const Py::Tuple& args)
|
|
|
f5ca97c |
return Py::Object(proxy, true);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
@@ -197,7 +197,7 @@ Py::Object View3DInventorViewerPy::setSceneGraph(const Py::Tuple& args)
|
|
|
f5ca97c |
return Py::None();
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
@@ -213,7 +213,7 @@ Py::Object View3DInventorViewerPy::getSoEventManager(const Py::Tuple& args)
|
|
|
f5ca97c |
return Py::Object(proxy, true);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
@@ -265,13 +265,13 @@ Py::Object View3DInventorViewerPy::setFocalDistance(const Py::Tuple& args)
|
|
|
f5ca97c |
throw; // re-throw
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
return Py::None();
|
|
|
f5ca97c |
@@ -287,13 +287,13 @@ Py::Object View3DInventorViewerPy::getFocalDistance(const Py::Tuple& args)
|
|
|
f5ca97c |
return Py::Float(d);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
@@ -311,7 +311,7 @@ Py::Object View3DInventorViewerPy::getPoint(const Py::Tuple& args)
|
|
|
f5ca97c |
return Py::Vector(Base::Vector3f(pt[0], pt[1], pt[2]));
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Py::Exception&) {
|
|
|
f5ca97c |
throw;
|
|
|
f5ca97c |
@@ -342,12 +342,12 @@ Py::Object View3DInventorViewerPy::setPickRadius(const Py::Tuple& args)
|
|
|
f5ca97c |
return Py::None();
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
diff --git a/src/Gui/ViewProviderPyImp.cpp b/src/Gui/ViewProviderPyImp.cpp
|
|
|
f5ca97c |
index 9a7cfd78e1..90a59b6372 100644
|
|
|
f5ca97c |
--- a/src/Gui/ViewProviderPyImp.cpp
|
|
|
f5ca97c |
+++ b/src/Gui/ViewProviderPyImp.cpp
|
|
|
f5ca97c |
@@ -306,7 +306,7 @@ Py::Object ViewProviderPy::getAnnotation(void) const
|
|
|
f5ca97c |
return Py::Object(Ptr, true);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
@@ -324,7 +324,7 @@ Py::Object ViewProviderPy::getRootNode(void) const
|
|
|
f5ca97c |
return Py::Object(Ptr, true);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
diff --git a/src/Gui/WidgetFactory.cpp b/src/Gui/WidgetFactory.cpp
|
|
|
f5ca97c |
index 4b49c0116b..d1340f9617 100644
|
|
|
f5ca97c |
--- a/src/Gui/WidgetFactory.cpp
|
|
|
f5ca97c |
+++ b/src/Gui/WidgetFactory.cpp
|
|
|
f5ca97c |
@@ -870,7 +870,7 @@ Py::Object UiLoaderPy::load(const Py::Tuple& args)
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
else {
|
|
|
f5ca97c |
- throw Py::Exception("string or QIODevice expected");
|
|
|
f5ca97c |
+ throw Py::TypeError("string or QIODevice expected");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
return Py::None();
|
|
|
f5ca97c |
diff --git a/src/Mod/Part/App/AppPartPy.cpp b/src/Mod/Part/App/AppPartPy.cpp
|
|
|
f5ca97c |
index 944a9868c1..7639423c7f 100644
|
|
|
f5ca97c |
--- a/src/Mod/Part/App/AppPartPy.cpp
|
|
|
f5ca97c |
+++ b/src/Mod/Part/App/AppPartPy.cpp
|
|
|
f5ca97c |
@@ -1277,7 +1277,7 @@ class Module : public Py::ExtensionModule<Module>
|
|
|
f5ca97c |
PyObject *pleft=Py_False;
|
|
|
f5ca97c |
if (!PyArg_ParseTuple(args.ptr(), "ddd|dO!", &pitch, &height, &radius, &angle,
|
|
|
f5ca97c |
&(PyBool_Type), &pleft)) {
|
|
|
f5ca97c |
- throw Py::Exception("Part.makeLongHelix fails on parms");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Part.makeLongHelix fails on parms");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
try {
|
|
|
f5ca97c |
diff --git a/src/Mod/Part/App/ArcOfConicPyImp.cpp b/src/Mod/Part/App/ArcOfConicPyImp.cpp
|
|
|
f5ca97c |
index dd2c8554fc..1790d13193 100644
|
|
|
f5ca97c |
--- a/src/Mod/Part/App/ArcOfConicPyImp.cpp
|
|
|
f5ca97c |
+++ b/src/Mod/Part/App/ArcOfConicPyImp.cpp
|
|
|
f5ca97c |
@@ -148,7 +148,7 @@ void ArcOfConicPy::setAxis(Py::Object arg)
|
|
|
f5ca97c |
conic->SetAxis(axis);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (Standard_Failure) {
|
|
|
f5ca97c |
- throw Py::Exception("cannot set axis");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("cannot set axis");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
@@ -188,7 +188,7 @@ void ArcOfConicPy::setXAxis(Py::Object arg)
|
|
|
f5ca97c |
conic->SetPosition(pos);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (Standard_Failure) {
|
|
|
f5ca97c |
- throw Py::Exception("cannot set X axis");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("cannot set X axis");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
@@ -228,7 +228,7 @@ void ArcOfConicPy::setYAxis(Py::Object arg)
|
|
|
f5ca97c |
conic->SetPosition(pos);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (Standard_Failure) {
|
|
|
f5ca97c |
- throw Py::Exception("cannot set Y axis");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("cannot set Y axis");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
diff --git a/src/Mod/Part/App/ConePyImp.cpp b/src/Mod/Part/App/ConePyImp.cpp
|
|
|
f5ca97c |
index 299644eec5..0316211e7d 100644
|
|
|
f5ca97c |
--- a/src/Mod/Part/App/ConePyImp.cpp
|
|
|
f5ca97c |
+++ b/src/Mod/Part/App/ConePyImp.cpp
|
|
|
f5ca97c |
@@ -296,7 +296,7 @@ void ConePy::setAxis(Py::Object arg)
|
|
|
f5ca97c |
this_surf->SetAxis(axis);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (Standard_Failure) {
|
|
|
f5ca97c |
- throw Py::Exception("cannot set axis");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("cannot set axis");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
diff --git a/src/Mod/Part/App/ConicPyImp.cpp b/src/Mod/Part/App/ConicPyImp.cpp
|
|
|
f5ca97c |
index 755ff5db6a..94a2fea337 100644
|
|
|
f5ca97c |
--- a/src/Mod/Part/App/ConicPyImp.cpp
|
|
|
f5ca97c |
+++ b/src/Mod/Part/App/ConicPyImp.cpp
|
|
|
f5ca97c |
@@ -151,7 +151,7 @@ void ConicPy::setAxis(Py::Object arg)
|
|
|
f5ca97c |
conic->SetAxis(axis);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (Standard_Failure) {
|
|
|
f5ca97c |
- throw Py::Exception("cannot set axis");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("cannot set axis");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
@@ -187,7 +187,7 @@ void ConicPy::setXAxis(Py::Object arg)
|
|
|
f5ca97c |
conic->SetPosition(pos);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (Standard_Failure) {
|
|
|
f5ca97c |
- throw Py::Exception("cannot set X axis");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("cannot set X axis");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
@@ -223,7 +223,7 @@ void ConicPy::setYAxis(Py::Object arg)
|
|
|
f5ca97c |
conic->SetPosition(pos);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (Standard_Failure) {
|
|
|
f5ca97c |
- throw Py::Exception("cannot set Y axis");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("cannot set Y axis");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
diff --git a/src/Mod/Part/App/CylinderPyImp.cpp b/src/Mod/Part/App/CylinderPyImp.cpp
|
|
|
f5ca97c |
index 13f171e70a..3b2f412db9 100644
|
|
|
f5ca97c |
--- a/src/Mod/Part/App/CylinderPyImp.cpp
|
|
|
f5ca97c |
+++ b/src/Mod/Part/App/CylinderPyImp.cpp
|
|
|
f5ca97c |
@@ -293,7 +293,7 @@ void CylinderPy::setAxis(Py::Object arg)
|
|
|
f5ca97c |
this_surf->SetAxis(axis);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (Standard_Failure) {
|
|
|
f5ca97c |
- throw Py::Exception("cannot set axis");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("cannot set axis");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
diff --git a/src/Mod/Part/App/Geom2d/Line2dPyImp.cpp b/src/Mod/Part/App/Geom2d/Line2dPyImp.cpp
|
|
|
f5ca97c |
index 476fd3445e..ba45036714 100644
|
|
|
f5ca97c |
--- a/src/Mod/Part/App/Geom2d/Line2dPyImp.cpp
|
|
|
f5ca97c |
+++ b/src/Mod/Part/App/Geom2d/Line2dPyImp.cpp
|
|
|
f5ca97c |
@@ -163,7 +163,7 @@ void Line2dPy::setLocation(Py::Object arg)
|
|
|
f5ca97c |
try {
|
|
|
f5ca97c |
GCE2d_MakeLine ms(pnt, dir);
|
|
|
f5ca97c |
if (!ms.IsDone()) {
|
|
|
f5ca97c |
- throw Py::Exception(gce_ErrorStatusText(ms.Status()));
|
|
|
f5ca97c |
+ throw Py::RuntimeError(gce_ErrorStatusText(ms.Status()));
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
// get Geom_Line of line
|
|
|
f5ca97c |
@@ -171,8 +171,7 @@ void Line2dPy::setLocation(Py::Object arg)
|
|
|
f5ca97c |
this_line->SetLin2d(that_line->Lin2d());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (Standard_Failure& e) {
|
|
|
f5ca97c |
-
|
|
|
f5ca97c |
- throw Py::Exception(e.GetMessageString());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.GetMessageString());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
@@ -218,7 +217,7 @@ void Line2dPy::setDirection(Py::Object arg)
|
|
|
f5ca97c |
try {
|
|
|
f5ca97c |
GCE2d_MakeLine ms(pnt, dir);
|
|
|
f5ca97c |
if (!ms.IsDone()) {
|
|
|
f5ca97c |
- throw Py::Exception(gce_ErrorStatusText(ms.Status()));
|
|
|
f5ca97c |
+ throw Py::RuntimeError(gce_ErrorStatusText(ms.Status()));
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
// get Geom_Line of line
|
|
|
f5ca97c |
@@ -226,8 +225,7 @@ void Line2dPy::setDirection(Py::Object arg)
|
|
|
f5ca97c |
this_line->SetLin2d(that_line->Lin2d());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (Standard_Failure& e) {
|
|
|
f5ca97c |
-
|
|
|
f5ca97c |
- throw Py::Exception(e.GetMessageString());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.GetMessageString());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
diff --git a/src/Mod/Part/App/Geom2d/Line2dSegmentPyImp.cpp b/src/Mod/Part/App/Geom2d/Line2dSegmentPyImp.cpp
|
|
|
f5ca97c |
index 2c3b8dde7f..6b6a1165b7 100644
|
|
|
f5ca97c |
--- a/src/Mod/Part/App/Geom2d/Line2dSegmentPyImp.cpp
|
|
|
f5ca97c |
+++ b/src/Mod/Part/App/Geom2d/Line2dSegmentPyImp.cpp
|
|
|
f5ca97c |
@@ -240,7 +240,7 @@ void Line2dSegmentPy::setStartPoint(Py::Object arg)
|
|
|
f5ca97c |
Standard_Failure::Raise("Both points are equal");
|
|
|
f5ca97c |
GCE2d_MakeSegment ms(p1, p2);
|
|
|
f5ca97c |
if (!ms.IsDone()) {
|
|
|
f5ca97c |
- throw Py::Exception(gce_ErrorStatusText(ms.Status()));
|
|
|
f5ca97c |
+ throw Py::RuntimeError(gce_ErrorStatusText(ms.Status()));
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
// get Geom_Line of line segment
|
|
|
f5ca97c |
@@ -252,8 +252,7 @@ void Line2dSegmentPy::setStartPoint(Py::Object arg)
|
|
|
f5ca97c |
this_curv->SetTrim(that_curv->FirstParameter(), that_curv->LastParameter());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (Standard_Failure& e) {
|
|
|
f5ca97c |
-
|
|
|
f5ca97c |
- throw Py::Exception(e.GetMessageString());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.GetMessageString());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
@@ -301,7 +300,7 @@ void Line2dSegmentPy::setEndPoint(Py::Object arg)
|
|
|
f5ca97c |
Standard_Failure::Raise("Both points are equal");
|
|
|
f5ca97c |
GCE2d_MakeSegment ms(p1, p2);
|
|
|
f5ca97c |
if (!ms.IsDone()) {
|
|
|
f5ca97c |
- throw Py::Exception(gce_ErrorStatusText(ms.Status()));
|
|
|
f5ca97c |
+ throw Py::RuntimeError(gce_ErrorStatusText(ms.Status()));
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
// get Geom_Line of line segment
|
|
|
f5ca97c |
@@ -313,8 +312,7 @@ void Line2dSegmentPy::setEndPoint(Py::Object arg)
|
|
|
f5ca97c |
this_curv->SetTrim(that_curv->FirstParameter(), that_curv->LastParameter());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (Standard_Failure& e) {
|
|
|
f5ca97c |
-
|
|
|
f5ca97c |
- throw Py::Exception(e.GetMessageString());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.GetMessageString());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
diff --git a/src/Mod/Part/App/Geom2d/OffsetCurve2dPyImp.cpp b/src/Mod/Part/App/Geom2d/OffsetCurve2dPyImp.cpp
|
|
|
f5ca97c |
index e852a2a5fb..e082168a80 100644
|
|
|
f5ca97c |
--- a/src/Mod/Part/App/Geom2d/OffsetCurve2dPyImp.cpp
|
|
|
f5ca97c |
+++ b/src/Mod/Part/App/Geom2d/OffsetCurve2dPyImp.cpp
|
|
|
f5ca97c |
@@ -122,8 +122,7 @@ void OffsetCurve2dPy::setBasisCurve(Py::Object arg)
|
|
|
f5ca97c |
curve2->SetBasisCurve(curve);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (Standard_Failure& e) {
|
|
|
f5ca97c |
-
|
|
|
f5ca97c |
- throw Py::Exception(e.GetMessageString());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.GetMessageString());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
diff --git a/src/Mod/Part/App/LinePyImp.cpp b/src/Mod/Part/App/LinePyImp.cpp
|
|
|
f5ca97c |
index 6bb058b873..fe3f4c4ac6 100644
|
|
|
f5ca97c |
--- a/src/Mod/Part/App/LinePyImp.cpp
|
|
|
f5ca97c |
+++ b/src/Mod/Part/App/LinePyImp.cpp
|
|
|
f5ca97c |
@@ -161,7 +161,7 @@ void LinePy::setLocation(Py::Object arg)
|
|
|
f5ca97c |
try {
|
|
|
f5ca97c |
GC_MakeLine ms(pnt, dir);
|
|
|
f5ca97c |
if (!ms.IsDone()) {
|
|
|
f5ca97c |
- throw Py::Exception(gce_ErrorStatusText(ms.Status()));
|
|
|
f5ca97c |
+ throw Py::RuntimeError(gce_ErrorStatusText(ms.Status()));
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
// get Geom_Line of line
|
|
|
f5ca97c |
@@ -169,8 +169,7 @@ void LinePy::setLocation(Py::Object arg)
|
|
|
f5ca97c |
this_curv->SetLin(that_curv->Lin());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (Standard_Failure& e) {
|
|
|
f5ca97c |
-
|
|
|
f5ca97c |
- throw Py::Exception(e.GetMessageString());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.GetMessageString());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
@@ -211,7 +210,7 @@ void LinePy::setDirection(Py::Object arg)
|
|
|
f5ca97c |
try {
|
|
|
f5ca97c |
GC_MakeLine ms(pnt, dir);
|
|
|
f5ca97c |
if (!ms.IsDone()) {
|
|
|
f5ca97c |
- throw Py::Exception(gce_ErrorStatusText(ms.Status()));
|
|
|
f5ca97c |
+ throw Py::RuntimeError(gce_ErrorStatusText(ms.Status()));
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
// get Geom_Line of line
|
|
|
f5ca97c |
@@ -219,8 +218,7 @@ void LinePy::setDirection(Py::Object arg)
|
|
|
f5ca97c |
this_curv->SetLin(that_curv->Lin());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (Standard_Failure& e) {
|
|
|
f5ca97c |
-
|
|
|
f5ca97c |
- throw Py::Exception(e.GetMessageString());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.GetMessageString());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
diff --git a/src/Mod/Part/App/LineSegmentPyImp.cpp b/src/Mod/Part/App/LineSegmentPyImp.cpp
|
|
|
f5ca97c |
index 2d8577cedc..0ad0854171 100644
|
|
|
f5ca97c |
--- a/src/Mod/Part/App/LineSegmentPyImp.cpp
|
|
|
f5ca97c |
+++ b/src/Mod/Part/App/LineSegmentPyImp.cpp
|
|
|
f5ca97c |
@@ -196,7 +196,6 @@ PyObject* LineSegmentPy::setParameterRange(PyObject *args)
|
|
|
f5ca97c |
this_curve->SetTrim(first, last);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (Standard_Failure& e) {
|
|
|
f5ca97c |
-
|
|
|
f5ca97c |
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
|
|
|
f5ca97c |
return NULL;
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
@@ -244,7 +243,7 @@ void LineSegmentPy::setStartPoint(Py::Object arg)
|
|
|
f5ca97c |
Standard_Failure::Raise("Both points are equal");
|
|
|
f5ca97c |
GC_MakeSegment ms(p1, p2);
|
|
|
f5ca97c |
if (!ms.IsDone()) {
|
|
|
f5ca97c |
- throw Py::Exception(gce_ErrorStatusText(ms.Status()));
|
|
|
f5ca97c |
+ throw Py::RuntimeError(gce_ErrorStatusText(ms.Status()));
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
// get Geom_Line of line segment
|
|
|
f5ca97c |
@@ -256,8 +255,7 @@ void LineSegmentPy::setStartPoint(Py::Object arg)
|
|
|
f5ca97c |
this_curv->SetTrim(that_curv->FirstParameter(), that_curv->LastParameter());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (Standard_Failure& e) {
|
|
|
f5ca97c |
-
|
|
|
f5ca97c |
- throw Py::Exception(e.GetMessageString());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.GetMessageString());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
@@ -301,7 +299,7 @@ void LineSegmentPy::setEndPoint(Py::Object arg)
|
|
|
f5ca97c |
Standard_Failure::Raise("Both points are equal");
|
|
|
f5ca97c |
GC_MakeSegment ms(p1, p2);
|
|
|
f5ca97c |
if (!ms.IsDone()) {
|
|
|
f5ca97c |
- throw Py::Exception(gce_ErrorStatusText(ms.Status()));
|
|
|
f5ca97c |
+ throw Py::RuntimeError(gce_ErrorStatusText(ms.Status()));
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
// get Geom_Line of line segment
|
|
|
f5ca97c |
@@ -313,8 +311,7 @@ void LineSegmentPy::setEndPoint(Py::Object arg)
|
|
|
f5ca97c |
this_curv->SetTrim(that_curv->FirstParameter(), that_curv->LastParameter());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (Standard_Failure& e) {
|
|
|
f5ca97c |
-
|
|
|
f5ca97c |
- throw Py::Exception(e.GetMessageString());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.GetMessageString());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
diff --git a/src/Mod/Part/App/OffsetCurvePyImp.cpp b/src/Mod/Part/App/OffsetCurvePyImp.cpp
|
|
|
f5ca97c |
index 1849764e8a..839ef667bc 100644
|
|
|
f5ca97c |
--- a/src/Mod/Part/App/OffsetCurvePyImp.cpp
|
|
|
f5ca97c |
+++ b/src/Mod/Part/App/OffsetCurvePyImp.cpp
|
|
|
f5ca97c |
@@ -145,8 +145,7 @@ void OffsetCurvePy::setBasisCurve(Py::Object arg)
|
|
|
f5ca97c |
curve2->SetBasisCurve(curve);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (Standard_Failure& e) {
|
|
|
f5ca97c |
-
|
|
|
f5ca97c |
- throw Py::Exception(e.GetMessageString());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.GetMessageString());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
diff --git a/src/Mod/Part/App/OffsetSurfacePyImp.cpp b/src/Mod/Part/App/OffsetSurfacePyImp.cpp
|
|
|
f5ca97c |
index 2e2996e47d..32d44cd446 100644
|
|
|
f5ca97c |
--- a/src/Mod/Part/App/OffsetSurfacePyImp.cpp
|
|
|
f5ca97c |
+++ b/src/Mod/Part/App/OffsetSurfacePyImp.cpp
|
|
|
f5ca97c |
@@ -120,8 +120,7 @@ void OffsetSurfacePy::setBasisSurface(Py::Object arg)
|
|
|
f5ca97c |
surf2->SetBasisSurface(surf);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (Standard_Failure& e) {
|
|
|
f5ca97c |
-
|
|
|
f5ca97c |
- throw Py::Exception(e.GetMessageString());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.GetMessageString());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
diff --git a/src/Mod/Part/App/PlanePyImp.cpp b/src/Mod/Part/App/PlanePyImp.cpp
|
|
|
f5ca97c |
index 863dd7fb22..aa2ac03164 100644
|
|
|
f5ca97c |
--- a/src/Mod/Part/App/PlanePyImp.cpp
|
|
|
f5ca97c |
+++ b/src/Mod/Part/App/PlanePyImp.cpp
|
|
|
f5ca97c |
@@ -208,8 +208,7 @@ void PlanePy::setPosition(Py::Object arg)
|
|
|
f5ca97c |
this_surf->SetLocation(loc);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (Standard_Failure& e) {
|
|
|
f5ca97c |
-
|
|
|
f5ca97c |
- throw Py::Exception(e.GetMessageString());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.GetMessageString());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
@@ -252,7 +251,7 @@ void PlanePy::setAxis(Py::Object arg)
|
|
|
f5ca97c |
this_surf->SetAxis(axis);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (Standard_Failure) {
|
|
|
f5ca97c |
- throw Py::Exception("cannot set axis");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("cannot set axis");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
diff --git a/src/Mod/Part/App/PointPyImp.cpp b/src/Mod/Part/App/PointPyImp.cpp
|
|
|
f5ca97c |
index 115e0a56d9..3502ea85b6 100644
|
|
|
f5ca97c |
--- a/src/Mod/Part/App/PointPyImp.cpp
|
|
|
f5ca97c |
+++ b/src/Mod/Part/App/PointPyImp.cpp
|
|
|
f5ca97c |
@@ -144,8 +144,7 @@ void PointPy::setX(Py::Float X)
|
|
|
f5ca97c |
this_point->SetX(double(X));
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (Standard_Failure& e) {
|
|
|
f5ca97c |
-
|
|
|
f5ca97c |
- throw Py::Exception(e.GetMessageString());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.GetMessageString());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
@@ -165,8 +164,7 @@ void PointPy::setY(Py::Float Y)
|
|
|
f5ca97c |
this_point->SetY(double(Y));
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (Standard_Failure& e) {
|
|
|
f5ca97c |
-
|
|
|
f5ca97c |
- throw Py::Exception(e.GetMessageString());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.GetMessageString());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
@@ -186,8 +184,7 @@ void PointPy::setZ(Py::Float Z)
|
|
|
f5ca97c |
this_point->SetZ(double(Z));
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (Standard_Failure& e) {
|
|
|
f5ca97c |
-
|
|
|
f5ca97c |
- throw Py::Exception(e.GetMessageString());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.GetMessageString());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
diff --git a/src/Mod/Part/App/SpherePyImp.cpp b/src/Mod/Part/App/SpherePyImp.cpp
|
|
|
f5ca97c |
index 13f93577b4..7220da3cf4 100644
|
|
|
f5ca97c |
--- a/src/Mod/Part/App/SpherePyImp.cpp
|
|
|
f5ca97c |
+++ b/src/Mod/Part/App/SpherePyImp.cpp
|
|
|
f5ca97c |
@@ -177,7 +177,7 @@ void SpherePy::setAxis(Py::Object arg)
|
|
|
f5ca97c |
this_surf->SetAxis(axis);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (Standard_Failure) {
|
|
|
f5ca97c |
- throw Py::Exception("cannot set axis");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("cannot set axis");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
diff --git a/src/Mod/Part/App/SurfaceOfExtrusionPyImp.cpp b/src/Mod/Part/App/SurfaceOfExtrusionPyImp.cpp
|
|
|
f5ca97c |
index 201dc878d2..0df2611b78 100644
|
|
|
f5ca97c |
--- a/src/Mod/Part/App/SurfaceOfExtrusionPyImp.cpp
|
|
|
f5ca97c |
+++ b/src/Mod/Part/App/SurfaceOfExtrusionPyImp.cpp
|
|
|
f5ca97c |
@@ -139,8 +139,7 @@ void SurfaceOfExtrusionPy::setBasisCurve(Py::Object arg)
|
|
|
f5ca97c |
curve2->SetBasisCurve(curve);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (Standard_Failure& e) {
|
|
|
f5ca97c |
-
|
|
|
f5ca97c |
- throw Py::Exception(e.GetMessageString());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.GetMessageString());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
diff --git a/src/Mod/Part/App/SurfaceOfRevolutionPyImp.cpp b/src/Mod/Part/App/SurfaceOfRevolutionPyImp.cpp
|
|
|
f5ca97c |
index b467accecf..fbb6fe20e1 100644
|
|
|
f5ca97c |
--- a/src/Mod/Part/App/SurfaceOfRevolutionPyImp.cpp
|
|
|
f5ca97c |
+++ b/src/Mod/Part/App/SurfaceOfRevolutionPyImp.cpp
|
|
|
f5ca97c |
@@ -166,8 +166,7 @@ void SurfaceOfRevolutionPy::setBasisCurve(Py::Object arg)
|
|
|
f5ca97c |
curve2->SetBasisCurve(curve);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (Standard_Failure& e) {
|
|
|
f5ca97c |
-
|
|
|
f5ca97c |
- throw Py::Exception(e.GetMessageString());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.GetMessageString());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
diff --git a/src/Mod/Part/App/TopoShapeEdgePyImp.cpp b/src/Mod/Part/App/TopoShapeEdgePyImp.cpp
|
|
|
f5ca97c |
index 633fd88052..f0a046887b 100644
|
|
|
f5ca97c |
--- a/src/Mod/Part/App/TopoShapeEdgePyImp.cpp
|
|
|
f5ca97c |
+++ b/src/Mod/Part/App/TopoShapeEdgePyImp.cpp
|
|
|
f5ca97c |
@@ -1000,7 +1000,7 @@ Py::Dict TopoShapeEdgePy::getPrincipalProperties(void) const
|
|
|
f5ca97c |
Py::Boolean TopoShapeEdgePy::getClosed(void) const
|
|
|
f5ca97c |
{
|
|
|
f5ca97c |
if (getTopoShapePtr()->getShape().IsNull())
|
|
|
f5ca97c |
- throw Py::Exception("Cannot determine the 'Closed'' flag of an empty shape");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Cannot determine the 'Closed'' flag of an empty shape");
|
|
|
f5ca97c |
Standard_Boolean ok = BRep_Tool::IsClosed(getTopoShapePtr()->getShape());
|
|
|
f5ca97c |
return Py::Boolean(ok ? true : false);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
diff --git a/src/Mod/Part/App/TopoShapeFacePyImp.cpp b/src/Mod/Part/App/TopoShapeFacePyImp.cpp
|
|
|
f5ca97c |
index a270a47cfe..0f9a7df0dd 100644
|
|
|
f5ca97c |
--- a/src/Mod/Part/App/TopoShapeFacePyImp.cpp
|
|
|
f5ca97c |
+++ b/src/Mod/Part/App/TopoShapeFacePyImp.cpp
|
|
|
f5ca97c |
@@ -873,14 +873,14 @@ Py::Object TopoShapeFacePy::getOuterWire(void) const
|
|
|
f5ca97c |
{
|
|
|
f5ca97c |
const TopoDS_Shape& clSh = getTopoShapePtr()->getShape();
|
|
|
f5ca97c |
if (clSh.IsNull())
|
|
|
f5ca97c |
- throw Py::Exception("Null shape");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Null shape");
|
|
|
f5ca97c |
if (clSh.ShapeType() == TopAbs_FACE) {
|
|
|
f5ca97c |
TopoDS_Face clFace = (TopoDS_Face&)clSh;
|
|
|
f5ca97c |
TopoDS_Wire clWire = ShapeAnalysis::OuterWire(clFace);
|
|
|
f5ca97c |
return Py::Object(new TopoShapeWirePy(new TopoShape(clWire)),true);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
else {
|
|
|
f5ca97c |
- throw Py::Exception("Internal error, TopoDS_Shape is not a face!");
|
|
|
f5ca97c |
+ throw Py::TypeError("Internal error, TopoDS_Shape is not a face!");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
diff --git a/src/Mod/Part/App/ToroidPyImp.cpp b/src/Mod/Part/App/ToroidPyImp.cpp
|
|
|
f5ca97c |
index 33642b8b0b..18bbcec911 100644
|
|
|
f5ca97c |
--- a/src/Mod/Part/App/ToroidPyImp.cpp
|
|
|
f5ca97c |
+++ b/src/Mod/Part/App/ToroidPyImp.cpp
|
|
|
f5ca97c |
@@ -119,7 +119,7 @@ void ToroidPy::setMajorRadius(Py::Float arg)
|
|
|
f5ca97c |
torus->SetMajorRadius((double)arg);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (Standard_Failure) {
|
|
|
f5ca97c |
- throw Py::Exception("Major radius must be positive and higher than minor radius");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Major radius must be positive and higher than minor radius");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
@@ -138,7 +138,7 @@ void ToroidPy::setMinorRadius(Py::Float arg)
|
|
|
f5ca97c |
torus->SetMinorRadius((double)arg);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (Standard_Failure) {
|
|
|
f5ca97c |
- throw Py::Exception("Minor radius must be positive and lower than major radius");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Minor radius must be positive and lower than major radius");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
@@ -205,7 +205,7 @@ void ToroidPy::setAxis(Py::Object arg)
|
|
|
f5ca97c |
this_surf->SetAxis(axis);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (Standard_Failure) {
|
|
|
f5ca97c |
- throw Py::Exception("cannot set axis");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("cannot set axis");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
diff --git a/src/Mod/Path/App/CommandPyImp.cpp b/src/Mod/Path/App/CommandPyImp.cpp
|
|
|
f5ca97c |
index 6d302af130..7bf469c578 100644
|
|
|
f5ca97c |
--- a/src/Mod/Path/App/CommandPyImp.cpp
|
|
|
f5ca97c |
+++ b/src/Mod/Path/App/CommandPyImp.cpp
|
|
|
f5ca97c |
@@ -168,7 +168,7 @@ void CommandPy::setParameters(Py::Dict arg)
|
|
|
f5ca97c |
#endif
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
else {
|
|
|
f5ca97c |
- throw Py::Exception("The dictionary can only contain string keys");
|
|
|
f5ca97c |
+ throw Py::TypeError("The dictionary can only contain string keys");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
boost::to_upper(ckey);
|
|
|
f5ca97c |
@@ -185,7 +185,7 @@ void CommandPy::setParameters(Py::Dict arg)
|
|
|
f5ca97c |
cvalue = PyFloat_AsDouble(value);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
else {
|
|
|
f5ca97c |
- throw Py::Exception("The dictionary can only contain number values");
|
|
|
f5ca97c |
+ throw Py::TypeError("The dictionary can only contain number values");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
getCommandPtr()->Parameters[ckey]=cvalue;
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
@@ -202,7 +202,7 @@ PyObject* CommandPy::toGCode(PyObject *args)
|
|
|
f5ca97c |
return PyString_FromString(getCommandPtr()->toGCode().c_str());
|
|
|
f5ca97c |
#endif
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
- throw Py::Exception("This method accepts no argument");
|
|
|
f5ca97c |
+ throw Py::TypeError("This method accepts no argument");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
PyObject* CommandPy::setFromGCode(PyObject *args)
|
|
|
f5ca97c |
@@ -214,7 +214,7 @@ PyObject* CommandPy::setFromGCode(PyObject *args)
|
|
|
f5ca97c |
Py_INCREF(Py_None);
|
|
|
f5ca97c |
return Py_None;
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
- throw Py::Exception("Argument must be a string");
|
|
|
f5ca97c |
+ throw Py::TypeError("Argument must be a string");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
// Placement attribute get/set
|
|
|
f5ca97c |
@@ -231,7 +231,7 @@ void CommandPy::setPlacement(Py::Object arg)
|
|
|
f5ca97c |
if(arg.isType(PlacementType)) {
|
|
|
f5ca97c |
getCommandPtr()->setFromPlacement( *static_cast<Base::PlacementPy*>((*arg))->getPlacementPtr() );
|
|
|
f5ca97c |
} else
|
|
|
f5ca97c |
- throw Py::Exception("Argument must be a placement");
|
|
|
f5ca97c |
+ throw Py::TypeError("Argument must be a placement");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
PyObject* CommandPy::transform(PyObject *args)
|
|
|
f5ca97c |
@@ -242,7 +242,7 @@ PyObject* CommandPy::transform(PyObject *args)
|
|
|
f5ca97c |
Path::Command trCmd = getCommandPtr()->transform( *p->getPlacementPtr() );
|
|
|
f5ca97c |
return new CommandPy(new Path::Command(trCmd));
|
|
|
f5ca97c |
} else
|
|
|
f5ca97c |
- throw Py::Exception("Argument must be a placement");
|
|
|
f5ca97c |
+ throw Py::TypeError("Argument must be a placement");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
// custom attributes get/set
|
|
|
f5ca97c |
diff --git a/src/Mod/Path/App/PathPyImp.cpp b/src/Mod/Path/App/PathPyImp.cpp
|
|
|
f5ca97c |
index 3bba29b46f..11de15a4f5 100644
|
|
|
f5ca97c |
--- a/src/Mod/Path/App/PathPyImp.cpp
|
|
|
f5ca97c |
+++ b/src/Mod/Path/App/PathPyImp.cpp
|
|
|
f5ca97c |
@@ -100,7 +100,7 @@ void PathPy::setCommands(Py::List list)
|
|
|
f5ca97c |
Path::Command &cmd = *static_cast<Path::CommandPy*>((*it).ptr())->getCommandPtr();
|
|
|
f5ca97c |
getToolpathPtr()->addCommand(cmd);
|
|
|
f5ca97c |
} else {
|
|
|
f5ca97c |
- throw Py::Exception("The list can only contain Path Commands");
|
|
|
f5ca97c |
+ throw Py::TypeError("The list can only contain Path Commands");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
@@ -124,7 +124,7 @@ PyObject* PathPy::copy(PyObject * args)
|
|
|
f5ca97c |
if (PyArg_ParseTuple(args, "")) {
|
|
|
f5ca97c |
return new PathPy(new Path::Toolpath(*getToolpathPtr()));
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
- throw Py::Exception("This method accepts no argument");
|
|
|
f5ca97c |
+ throw Py::TypeError("This method accepts no argument");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
PyObject* PathPy::addCommands(PyObject * args)
|
|
|
f5ca97c |
@@ -184,7 +184,7 @@ PyObject* PathPy::toGCode(PyObject * args)
|
|
|
f5ca97c |
return PyString_FromString(result.c_str());
|
|
|
f5ca97c |
#endif
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
- throw Py::Exception("This method accepts no argument");
|
|
|
f5ca97c |
+ throw Py::TypeError("This method accepts no argument");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
PyObject* PathPy::setFromGCode(PyObject * args)
|
|
|
f5ca97c |
@@ -196,7 +196,7 @@ PyObject* PathPy::setFromGCode(PyObject * args)
|
|
|
f5ca97c |
Py_INCREF(Py_None);
|
|
|
f5ca97c |
return Py_None;
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
- throw Py::Exception("Argument must be a string");
|
|
|
f5ca97c |
+ throw Py::TypeError("Argument must be a string");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
// custom attributes get/set
|
|
|
f5ca97c |
diff --git a/src/Mod/Path/App/TooltablePyImp.cpp b/src/Mod/Path/App/TooltablePyImp.cpp
|
|
|
f5ca97c |
index 63e4adfdaa..17cb3fe59e 100644
|
|
|
f5ca97c |
--- a/src/Mod/Path/App/TooltablePyImp.cpp
|
|
|
f5ca97c |
+++ b/src/Mod/Path/App/TooltablePyImp.cpp
|
|
|
f5ca97c |
@@ -223,7 +223,7 @@ PyObject* ToolPy::copy(PyObject * args)
|
|
|
f5ca97c |
if (PyArg_ParseTuple(args, "")) {
|
|
|
f5ca97c |
return new ToolPy(new Path::Tool(*getToolPtr()));
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
- throw Py::Exception("This method accepts no argument");
|
|
|
f5ca97c |
+ throw Py::TypeError("This method accepts no argument");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
PyObject* ToolPy::setFromTemplate(PyObject * args)
|
|
|
f5ca97c |
@@ -276,7 +276,7 @@ PyObject* ToolPy::templateAttrs(PyObject * args)
|
|
|
f5ca97c |
PyDict_SetItemString(dict, "cuttingEdgeHeight", PyFloat_FromDouble(getToolPtr()->CuttingEdgeHeight));
|
|
|
f5ca97c |
return dict;
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
- throw Py::Exception("This method accepts no argument");
|
|
|
f5ca97c |
+ throw Py::TypeError("This method accepts no argument");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
PyObject* ToolPy::getToolTypes(PyObject * args)
|
|
|
f5ca97c |
@@ -290,7 +290,7 @@ PyObject* ToolPy::getToolTypes(PyObject * args)
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
return list;
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
- throw Py::Exception("This method accepts no argument");
|
|
|
f5ca97c |
+ throw Py::TypeError("This method accepts no argument");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
PyObject* ToolPy::getToolMaterials(PyObject * args)
|
|
|
f5ca97c |
@@ -304,7 +304,7 @@ PyObject* ToolPy::getToolMaterials(PyObject * args)
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
return list;
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
- throw Py::Exception("This method accepts no argument");
|
|
|
f5ca97c |
+ throw Py::TypeError("This method accepts no argument");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
|
|
|
f5ca97c |
@@ -405,7 +405,7 @@ void TooltablePy::setTools(Py::Dict arg)
|
|
|
f5ca97c |
Py_DECREF(success);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
} else {
|
|
|
f5ca97c |
- throw Py::Exception("The dictionary can only contain int:tool pairs");
|
|
|
f5ca97c |
+ throw Py::TypeError("The dictionary can only contain int:tool pairs");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
@@ -417,7 +417,7 @@ PyObject* TooltablePy::copy(PyObject * args)
|
|
|
f5ca97c |
if (PyArg_ParseTuple(args, "")) {
|
|
|
f5ca97c |
return new TooltablePy(new Path::Tooltable(*getTooltablePtr()));
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
- throw Py::Exception("This method accepts no argument");
|
|
|
f5ca97c |
+ throw Py::TypeError("This method accepts no argument");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
PyObject* TooltablePy::addTools(PyObject * args)
|
|
|
f5ca97c |
diff --git a/src/Mod/Sandbox/App/DocumentProtectorPy.cpp b/src/Mod/Sandbox/App/DocumentProtectorPy.cpp
|
|
|
f5ca97c |
index a02b803a06..5e5e1ca271 100644
|
|
|
f5ca97c |
--- a/src/Mod/Sandbox/App/DocumentProtectorPy.cpp
|
|
|
f5ca97c |
+++ b/src/Mod/Sandbox/App/DocumentProtectorPy.cpp
|
|
|
f5ca97c |
@@ -79,13 +79,13 @@ PyObject *DocumentProtectorPy::method_varargs_ext_handler(PyObject *_self_and_na
|
|
|
f5ca97c |
return pycxx_handler(_self_and_name_tuple, _args);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const Base::Exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch (const std::exception& e) {
|
|
|
f5ca97c |
- throw Py::Exception(e.what());
|
|
|
f5ca97c |
+ throw Py::RuntimeError(e.what());
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
catch(...) {
|
|
|
f5ca97c |
- throw Py::Exception("Unknown C++ exception");
|
|
|
f5ca97c |
+ throw Py::RuntimeError("Unknown C++ exception");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
diff --git a/src/Mod/TechDraw/App/AppTechDrawPy.cpp b/src/Mod/TechDraw/App/AppTechDrawPy.cpp
|
|
|
f5ca97c |
index a793f38d43..512e5588d3 100644
|
|
|
f5ca97c |
--- a/src/Mod/TechDraw/App/AppTechDrawPy.cpp
|
|
|
f5ca97c |
+++ b/src/Mod/TechDraw/App/AppTechDrawPy.cpp
|
|
|
f5ca97c |
@@ -134,7 +134,7 @@ class Module : public Py::ExtensionModule<Module>
|
|
|
f5ca97c |
PyObject *pcObj;
|
|
|
f5ca97c |
PyObject *inclBig = Py_True;
|
|
|
f5ca97c |
if (!PyArg_ParseTuple(args.ptr(), "O!|O", &(PyList_Type), &pcObj, &inclBig)) {
|
|
|
f5ca97c |
- throw Py::Exception("expected (listofedges,boolean");
|
|
|
f5ca97c |
+ throw Py::TypeError("expected (listofedges,boolean");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
std::vector<TopoDS_Edge> edgeList;
|
|
|
f5ca97c |
@@ -191,7 +191,7 @@ class Module : public Py::ExtensionModule<Module>
|
|
|
f5ca97c |
{
|
|
|
f5ca97c |
PyObject *pcObj;
|
|
|
f5ca97c |
if (!PyArg_ParseTuple(args.ptr(), "O!", &(PyList_Type), &pcObj)) {
|
|
|
f5ca97c |
- throw Py::Exception("expected (listofedges)");
|
|
|
f5ca97c |
+ throw Py::TypeError("expected (listofedges)");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
std::vector<TopoDS_Edge> edgeList;
|
|
|
f5ca97c |
@@ -248,7 +248,7 @@ class Module : public Py::ExtensionModule<Module>
|
|
|
f5ca97c |
if (!PyArg_ParseTuple(args.ptr(), "OdO", &pcObjShape,
|
|
|
f5ca97c |
&scale,
|
|
|
f5ca97c |
&pcObjDir)) {
|
|
|
f5ca97c |
- throw Py::Exception("expected (shape,scale,direction");
|
|
|
f5ca97c |
+ throw Py::TypeError("expected (shape,scale,direction");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
if (!PyObject_TypeCheck(pcObjShape, &(TopoShapePy::Type))) {
|
|
|
f5ca97c |
@@ -308,7 +308,7 @@ class Module : public Py::ExtensionModule<Module>
|
|
|
f5ca97c |
{
|
|
|
f5ca97c |
PyObject *viewObj;
|
|
|
f5ca97c |
if (!PyArg_ParseTuple(args.ptr(), "O", &viewObj)) {
|
|
|
f5ca97c |
- throw Py::Exception("expected (DrawViewPart)");
|
|
|
f5ca97c |
+ throw Py::TypeError("expected (DrawViewPart)");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
Py::String dxfReturn;
|
|
|
f5ca97c |
|
|
|
f5ca97c |
@@ -363,7 +363,7 @@ class Module : public Py::ExtensionModule<Module>
|
|
|
f5ca97c |
{
|
|
|
f5ca97c |
PyObject *viewObj;
|
|
|
f5ca97c |
if (!PyArg_ParseTuple(args.ptr(), "O", &viewObj)) {
|
|
|
f5ca97c |
- throw Py::Exception("expected (DrawViewPart)");
|
|
|
f5ca97c |
+ throw Py::TypeError("expected (DrawViewPart)");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
Py::String svgReturn;
|
|
|
f5ca97c |
std::string grpHead1 = "
|
|
|
f5ca97c |
diff --git a/src/Mod/TechDraw/App/DrawViewSymbolPyImp.cpp b/src/Mod/TechDraw/App/DrawViewSymbolPyImp.cpp
|
|
|
f5ca97c |
index 16ea2dff3f..1e3723fce7 100644
|
|
|
f5ca97c |
--- a/src/Mod/TechDraw/App/DrawViewSymbolPyImp.cpp
|
|
|
f5ca97c |
+++ b/src/Mod/TechDraw/App/DrawViewSymbolPyImp.cpp
|
|
|
f5ca97c |
@@ -43,7 +43,7 @@ PyObject* DrawViewSymbolPy::dumpSymbol(PyObject *args)
|
|
|
f5ca97c |
} else {
|
|
|
f5ca97c |
std::string error = std::string("Can't write ");
|
|
|
f5ca97c |
error += fileSpec;
|
|
|
f5ca97c |
- throw Py::Exception(error);
|
|
|
f5ca97c |
+ throw Py::RuntimeError(error);
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
Py_Return;
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
diff --git a/src/Mod/TechDraw/Gui/AppTechDrawGuiPy.cpp b/src/Mod/TechDraw/Gui/AppTechDrawGuiPy.cpp
|
|
|
f5ca97c |
index 1cbf252b53..3ae34696f6 100644
|
|
|
f5ca97c |
--- a/src/Mod/TechDraw/Gui/AppTechDrawGuiPy.cpp
|
|
|
f5ca97c |
+++ b/src/Mod/TechDraw/Gui/AppTechDrawGuiPy.cpp
|
|
|
f5ca97c |
@@ -110,7 +110,7 @@ class Module : public Py::ExtensionModule<Module>
|
|
|
f5ca97c |
PyObject *pageObj;
|
|
|
f5ca97c |
char* name;
|
|
|
f5ca97c |
if (!PyArg_ParseTuple(args.ptr(), "Oet", &pageObj, "utf-8",&name)) {
|
|
|
f5ca97c |
- throw Py::Exception("expected (Page,path");
|
|
|
f5ca97c |
+ throw Py::TypeError("expected (Page,path");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
std::string filePath = std::string(name);
|
|
|
f5ca97c |
@@ -151,7 +151,7 @@ class Module : public Py::ExtensionModule<Module>
|
|
|
f5ca97c |
PyObject *pageObj;
|
|
|
f5ca97c |
char* name;
|
|
|
f5ca97c |
if (!PyArg_ParseTuple(args.ptr(), "Oet", &pageObj, "utf-8",&name)) {
|
|
|
f5ca97c |
- throw Py::Exception("expected (Page,path");
|
|
|
f5ca97c |
+ throw Py::TypeError("expected (Page,path");
|
|
|
f5ca97c |
}
|
|
|
f5ca97c |
|
|
|
f5ca97c |
std::string filePath = std::string(name);
|