Avoid calling new.unlock() in __deepcopy__()

since the new object's properties aren't necessarily deepcopied yet...
This commit is contained in:
Jan Petykiewicz 2022-06-08 20:58:04 -07:00
commit eb9682b1b8
3 changed files with 6 additions and 3 deletions

View file

@ -116,7 +116,8 @@ class Grid(LockableImpl, Repetition, metaclass=AutoSlots):
def __deepcopy__(self, memo: Dict = None) -> 'Grid':
memo = {} if memo is None else memo
new = copy.copy(self).unlock()
new = copy.copy(self)
LocakbleImpl.unlock(new)
new.locked = self.locked
return new