Skip to content

Commit 45164c1

Browse files
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.
1 parent ba7a0fa commit 45164c1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

include/pybind11/detail/common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,7 @@ constexpr const char
992992
struct error_scope {
993993
PyObject *type, *value, *trace;
994994
error_scope() { PyErr_Fetch(&type, &value, &trace); }
995+
error_scope(const error_scope &) = delete;
995996
~error_scope() { PyErr_Restore(type, value, trace); }
996997
};
997998

0 commit comments

Comments
 (0)