* Reproducer for https://github.com/pybind/pybind11/issues/3788

Expected to build & run as-is. Uncommenting reproduces the infinite recursion.

* Moving try_as_void_ptr_capsule() to the end of load_impl()

* Moving new test into the existing test_class_sh_void_ptr_capsule

* Experiment

* Remove comments and simplify the test cases.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Xiaofei Wang
2022-03-10 16:18:24 -08:00
committed by GitHub
parent bcc241fc4d
commit 9d4b4dffce
3 changed files with 31 additions and 29 deletions

View File

@@ -200,9 +200,6 @@ public:
if (!src) {
return false;
}
if (cpptype && try_as_void_ptr_capsule(src)) {
return true;
}
if (!typeinfo) {
return try_load_foreign_module_local(src);
}
@@ -295,7 +292,9 @@ public:
loaded_v_h = value_and_holder();
return true;
}
if (convert && cpptype && try_as_void_ptr_capsule(src)) {
return true;
}
return false;
}