mirror of
https://github.com/pybind/pybind11.git
synced 2026-05-12 09:17:42 +00:00
* Add `gil_scoped_acquire` to `shared_ptr_trampoline_self_life_support` ctor.
* Add test exercising fix & validation that the fix is needed (i.e. this is BROKEN).
test_class_sh_trampoline_shared_ptr_cpp_arg.py::test_std_make_shared_factory[pass_through_shd_ptr] PASSED [ 87%]
test_class_sh_trampoline_shared_ptr_cpp_arg.py::test_std_make_shared_factory[pass_through_shd_ptr_release_gil] FAILED [100%]
```
================================================================= FAILURES =================================================================
______________________________________ test_std_make_shared_factory[pass_through_shd_ptr_release_gil] ______________________________________
pass_through_func = <built-in method pass_through_shd_ptr_release_gil of PyCapsule object at 0x7f1b209707b0>
@pytest.mark.parametrize(
"pass_through_func", [m.pass_through_shd_ptr, m.pass_through_shd_ptr_release_gil]
)
def test_std_make_shared_factory(pass_through_func):
class PyChild(m.SpBase):
def __init__(self):
super().__init__(0)
obj = PyChild()
while True:
> assert pass_through_func(obj) is obj
E RuntimeError: NEEDED HERE: gil_scoped_acquire gil;
```
* Put back fix.