Commit 1a50086b authored by Daniel Brown's avatar Daniel Brown
Browse files

missing file

parent ea592218
Pipeline #1775 passed with stage
in 19 seconds
import warnings
def canFreeze(cls):
def _freeze(self): self.__dict__["____FROZEN____"] = True
def _unfreeze(self): self.__dict__["____FROZEN____"] = False
def frozensetattr(self, name, value):
if "____FROZEN____" in self.__dict__ and self.__dict__["____FROZEN____"] and not hasattr(self, name):
if hasattr(self, "name"):
n = self.name
elif hasattr(self, "__name"):
n = self.__name
else:
n = self.__class__.__name__
warnings.warn("'%s' does not have attribute called '%s'" % (n, name), stacklevel=2)
super(cls, self).__setattr__(name, value)
cls.__setattr__ = frozensetattr
cls._freeze = _freeze
cls._unfreeze = _unfreeze
return cls
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment