Skip to content

Commit 129c6cf

Browse files
Skylion007rwgk
authored andcommitted
Remove redundant exc checking
1 parent ad91190 commit 129c6cf

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

include/pybind11/pytypes.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2357,11 +2357,7 @@ args_proxy object_api<D>::operator*() const {
23572357
template <typename D>
23582358
template <typename T>
23592359
bool object_api<D>::contains(T &&item) const {
2360-
auto ret = attr("__contains__")(std::forward<T>(item)).template cast<bool>();
2361-
if (PyErr_Occurred()) {
2362-
throw error_already_set();
2363-
}
2364-
return ret;
2360+
return attr("__contains__")(std::forward<T>(item)).template cast<bool>();
23652361
}
23662362

23672363
template <typename D>

0 commit comments

Comments
 (0)