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.
This commit is contained in:
Oleksandr Pavlyk 2022-04-14 11:16:58 -05:00 committed by GitHub
parent ba7a0fac73
commit 45164c1fcb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -992,6 +992,7 @@ constexpr const char
struct error_scope { struct error_scope {
PyObject *type, *value, *trace; PyObject *type, *value, *trace;
error_scope() { PyErr_Fetch(&type, &value, &trace); } error_scope() { PyErr_Fetch(&type, &value, &trace); }
error_scope(const error_scope &) = delete;
~error_scope() { PyErr_Restore(type, value, trace); } ~error_scope() { PyErr_Restore(type, value, trace); }
}; };