(proxy, xxxattr, *args, **kwargs)
| 125 | |
| 126 | |
| 127 | def _proxy_dereference(proxy, xxxattr, *args, **kwargs): |
| 128 | obj = object.__getattribute__(proxy, "__obj") |
| 129 | field_name = object.__getattribute__(proxy, "__field_name") |
| 130 | field = getattr(obj, field_name) # Disowns the C++ unique_ptr member. |
| 131 | assert field is not None |
| 132 | try: |
| 133 | return xxxattr(field, *args, **kwargs) |
| 134 | finally: |
| 135 | setattr(obj, field_name, field) # Disowns the temporary Python object (field). |
| 136 | |
| 137 | |
| 138 | @pytest.mark.parametrize("m_attr", ["m_uqmp", "m_uqcp"]) |
no test coverage detected