use std invalid argument instead of Exception in py constructor

This commit is contained in:
Christopher Lackner 2024-11-05 07:55:23 +01:00
parent 9a7a9fa445
commit 45acbbf6ef

View File

@ -170,7 +170,7 @@ DLL_HEADER void ExportNgOCCBasic(py::module &m)
.def(py::init([] (py::tuple pnt)
{
if (py::len(pnt) != 2)
throw Exception("need 2-tuple to create gp_Pnt2d");
throw std::invalid_argument("need 2-tuple to create gp_Pnt2d");
return gp_Pnt2d(py::cast<double>(pnt[0]),
py::cast<double>(pnt[1]));
}))