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