Skip to content

Commit

Permalink
fix: workaround for #2682 and #2422 by simply clearing the TypeError (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
bstaletic authored Nov 23, 2020
1 parent 087b07c commit 8adef2c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion include/pybind11/cast.h
Original file line number Diff line number Diff line change
Expand Up @@ -1870,7 +1870,14 @@ struct arg_v : arg {
#if !defined(NDEBUG)
, type(type_id<T>())
#endif
{ }
{
// Workaround! See:
// https://github.com/pybind/pybind11/issues/2336
// https://github.com/pybind/pybind11/pull/2685#issuecomment-731286700
if (PyErr_Occurred()) {
PyErr_Clear();
}
}

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

0 comments on commit 8adef2c

Please sign in to comment.