Commit 9aa21c5c authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

numpy_bind.hh: change exception name

parent 09100295
...@@ -91,7 +91,7 @@ struct add_edge_list ...@@ -91,7 +91,7 @@ struct add_edge_list
} }
found = true; found = true;
} }
catch (invalid_numpy_conversion& e) {} catch (InvalidNumpyConversion& e) {}
} }
}; };
}; };
...@@ -185,7 +185,7 @@ struct add_edge_list_hash ...@@ -185,7 +185,7 @@ struct add_edge_list_hash
} }
found = true; found = true;
} }
catch (invalid_numpy_conversion& e) {} catch (InvalidNumpyConversion& e) {}
} }
template <class Graph, class VProp> template <class Graph, class VProp>
...@@ -263,7 +263,7 @@ struct add_edge_list_hash ...@@ -263,7 +263,7 @@ struct add_edge_list_hash
} }
found = true; found = true;
} }
catch (invalid_numpy_conversion& e) {} catch (InvalidNumpyConversion& e) {}
} }
template <class Graph, class VProp> template <class Graph, class VProp>
...@@ -341,7 +341,7 @@ struct add_edge_list_hash ...@@ -341,7 +341,7 @@ struct add_edge_list_hash
} }
found = true; found = true;
} }
catch (invalid_numpy_conversion& e) {} catch (InvalidNumpyConversion& e) {}
} }
}; };
}; };
......
...@@ -157,13 +157,13 @@ public: ...@@ -157,13 +157,13 @@ public:
} }
}; };
struct invalid_numpy_conversion: struct InvalidNumpyConversion:
public std::exception public std::exception
{ {
string _error; string _error;
public: public:
invalid_numpy_conversion(const string& error) :_error(error) {} InvalidNumpyConversion(const string& error) :_error(error) {}
~invalid_numpy_conversion() throw () {} ~InvalidNumpyConversion() throw () {}
const char * what () const throw () {return _error.c_str();} const char * what () const throw () {return _error.c_str();}
}; };
...@@ -173,7 +173,7 @@ boost::multi_array_ref<ValueType,dim> get_array(boost::python::object points) ...@@ -173,7 +173,7 @@ boost::multi_array_ref<ValueType,dim> get_array(boost::python::object points)
PyArrayObject* pa = (PyArrayObject*) points.ptr(); PyArrayObject* pa = (PyArrayObject*) points.ptr();
if (PyArray_NDIM(pa) != dim) if (PyArray_NDIM(pa) != dim)
throw invalid_numpy_conversion("invalid array dimension!"); throw InvalidNumpyConversion("invalid array dimension!");
if (boost::mpl::at<numpy_types,ValueType>::type::value != PyArray_DESCR(pa)->type_num) if (boost::mpl::at<numpy_types,ValueType>::type::value != PyArray_DESCR(pa)->type_num)
{ {
...@@ -185,7 +185,7 @@ boost::multi_array_ref<ValueType,dim> get_array(boost::python::object points) ...@@ -185,7 +185,7 @@ boost::multi_array_ref<ValueType,dim> get_array(boost::python::object points)
error += " (id: " + boost::lexical_cast<string>(PyArray_DESCR(pa)->type_num) + ")"; error += " (id: " + boost::lexical_cast<string>(PyArray_DESCR(pa)->type_num) + ")";
error += ", wanted: " + string(gcc_demangle(typeid(ValueType).name())); error += ", wanted: " + string(gcc_demangle(typeid(ValueType).name()));
error += " (id: " + boost::lexical_cast<string>(boost::mpl::at<numpy_types,ValueType>::type::value) + ")"; error += " (id: " + boost::lexical_cast<string>(boost::mpl::at<numpy_types,ValueType>::type::value) + ")";
throw invalid_numpy_conversion(error); throw InvalidNumpyConversion(error);
} }
vector<size_t> shape(dim); vector<size_t> shape(dim);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment