diff --git a/include/pybind11/detail/common.h b/include/pybind11/detail/common.h index ea09bb3fd..b49313e44 100644 --- a/include/pybind11/detail/common.h +++ b/include/pybind11/detail/common.h @@ -992,6 +992,7 @@ constexpr const char struct error_scope { PyObject *type, *value, *trace; error_scope() { PyErr_Fetch(&type, &value, &trace); } + error_scope(const error_scope &) = delete; ~error_scope() { PyErr_Restore(type, value, trace); } };