Files
sunnypilot/common/utils.py
Shane Smiskol 451e171ad9 remove old cache wrapper (#32653)
* remove wrapper that is functools.cache

* format
2024-06-07 21:24:32 -07:00

12 lines
271 B
Python

class Freezable:
_frozen: bool = False
def freeze(self):
if not self._frozen:
self._frozen = True
def __setattr__(self, *args, **kwargs):
if self._frozen:
raise Exception("cannot modify frozen object")
super().__setattr__(*args, **kwargs)