From 45164c1fcb7b4af1c5f8263f37c16beea1aabb98 Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Thu, 14 Apr 2022 11:16:58 -0500 Subject: [PATCH] Added deleted copy constructor for error_scope to comply with rule of 3. (#3870) * Added deleted copy constructor for error_scope to comply with rule of 3. --- include/pybind11/detail/common.h | 1 + 1 file changed, 1 insertion(+) 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); } };