fix: workaround for #2682 and #2422 by simply clearing the TypeError (#2685)

This commit is contained in:
Boris Staletic 2020-11-23 19:02:25 +00:00 committed by GitHub
parent 087b07c8b7
commit 8adef2c7f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1870,7 +1870,14 @@ private:
#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