From 71c084f57f4946a52296a09c3b6ee72d2f5ece07 Mon Sep 17 00:00:00 2001 From: Sergey Lyskov Date: Sat, 7 May 2016 19:30:33 -0400 Subject: [PATCH] properly adding value_error exception --- include/pybind11/pybind11.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index c9b40b4b0..7af9b7537 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -422,6 +422,7 @@ protected: } } catch (const error_already_set &) { return nullptr; } catch (const index_error &e) { PyErr_SetString(PyExc_IndexError, e.what()); return nullptr; + } catch (const value_error &e) { PyErr_SetString(PyExc_ValueError, e.what()); return nullptr; } catch (const stop_iteration &e) { PyErr_SetString(PyExc_StopIteration, e.what()); return nullptr; } catch (const std::bad_alloc &e) { PyErr_SetString(PyExc_MemoryError, e.what()); return nullptr; } catch (const std::domain_error &e) { PyErr_SetString(PyExc_ValueError, e.what()); return nullptr;