| 122 | recurse = True |
| 123 | |
| 124 | class RecursiveLock(SoftReadWriteLock): |
| 125 | def __init__(self, *args: Any, **kwargs: Any) -> None: # ruff:ignore[any-type] # forwards the public constructor unchanged |
| 126 | if recurse: |
| 127 | RecursiveLock(lock_file) |
| 128 | super().__init__(*args, **kwargs) |
| 129 | |
| 130 | with pytest.raises(RuntimeError, match="Singleton lock construction is already active"): |
| 131 | RecursiveLock(lock_file) |