this should be

```python
try:
    yield
finally:
    self.updating = False
```

to protect the state against exceptions.