fixed bug when adding adaptive_storage to itself, more test coverage

This commit is contained in:
hans.dembinski@gmail.com
2017-02-02 01:22:12 +00:00
parent 2798afffcb
commit afd7f9db21
5 changed files with 85 additions and 29 deletions

View File

@@ -231,12 +231,14 @@ histogram_variance(python::tuple args, python::dict kwargs) {
struct storage_access {
static
python::dict
python::object
array_interface(dynamic_histogram<>& self) {
const auto& b = self.storage_.buffer_;
if (b.type_.id_ == 5) {
PyErr_SetString(PyExc_RuntimeError, "cannot convert multiprecision storage to numpy array");
boost::python::throw_error_already_set();
// PyErr_SetString(PyExc_KeyError, "cannot convert multiprecision storage to numpy array");
// python::throw_error_already_set();
// workaround: for some reason, exception is ignored here
return python::object();
}
python::dict d;