Skip to content

Commit

Permalink
Workaround for pybind#2682 and pybind#2422 by simply clearing the Typ…
Browse files Browse the repository at this point in the history
…eError
  • Loading branch information
bstaletic committed Nov 20, 2020
1 parent af8849f commit 3906d5c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion include/pybind11/cast.h
Original file line number Diff line number Diff line change
Expand Up @@ -1870,7 +1870,12 @@ struct arg_v : arg {
#if !defined(NDEBUG)
, type(type_id<T>())
#endif
{ }
{
// Workaround! See https://github.com/pybind/pybind11/issues/2336
if (PyErr_Occurred()) {
PyErr_Clear();
}
}

public:
/// Direct construction with name, default, and description
Expand Down

0 comments on commit 3906d5c

Please sign in to comment.