mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-29 08:32:02 +00:00
Merge pull request #304 from trygvis/pybind-303
Changes accessor::operator=() to throw error_already_set() instead of using pybind11_fail().
This commit is contained in:
commit
f5d00105ce
@ -117,10 +117,10 @@ public:
|
||||
void operator=(const handle &value) {
|
||||
if (attr) {
|
||||
if (PyObject_SetAttr(obj.ptr(), key.ptr(), value.ptr()) == -1)
|
||||
pybind11_fail("Unable to set object attribute");
|
||||
throw error_already_set();
|
||||
} else {
|
||||
if (PyObject_SetItem(obj.ptr(), key.ptr(), value.ptr()) == -1)
|
||||
pybind11_fail("Unable to set object item");
|
||||
throw error_already_set();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user