use eoExceptions everywhere
This commit is contained in:
parent
75ac37b02a
commit
eba2e14950
127 changed files with 524 additions and 418 deletions
|
|
@ -115,13 +115,13 @@ PyEO& pop_getitem(eoPop<PyEO>& pop, boost::python::object key)
|
|||
{
|
||||
boost::python::extract<int> x(key);
|
||||
if (!x.check())
|
||||
throw index_error("Slicing not allowed");
|
||||
throw eoException("Slicing not allowed");
|
||||
|
||||
int i = x();
|
||||
|
||||
if (static_cast<unsigned>(i) >= pop.size())
|
||||
{
|
||||
throw index_error("Index out of bounds");
|
||||
throw eoException("Index out of bounds");
|
||||
}
|
||||
return pop[i];
|
||||
}
|
||||
|
|
@ -130,13 +130,13 @@ void pop_setitem(eoPop<PyEO>& pop, boost::python::object key, PyEO& value)
|
|||
{
|
||||
boost::python::extract<int> x(key);
|
||||
if (!x.check())
|
||||
throw index_error("Slicing not allowed");
|
||||
throw eoException("Slicing not allowed");
|
||||
|
||||
int i = x();
|
||||
|
||||
if (static_cast<unsigned>(i) >= pop.size())
|
||||
{
|
||||
throw index_error("Index out of bounds");
|
||||
throw eoException("Index out of bounds");
|
||||
}
|
||||
|
||||
pop[i] = value;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue