fix locking issue in __deepcopy__

This commit is contained in:
Jan Petykiewicz 2019-12-13 01:25:38 -08:00
parent e0db621595
commit f2e6548d21
3 changed files with 6 additions and 3 deletions

View File

@ -102,8 +102,9 @@ class Label:
def __deepcopy__(self, memo: Dict = None) -> 'Label': def __deepcopy__(self, memo: Dict = None) -> 'Label':
memo = {} if memo is None else memo memo = {} if memo is None else memo
new = copy.copy(self) new = copy.copy(self).unlock()
new._offset = self._offset.copy() new._offset = self._offset.copy()
new.locked = self.locked
return new return new
def copy(self) -> 'Label': def copy(self) -> 'Label':

View File

@ -127,8 +127,9 @@ class GridRepetition:
def __deepcopy__(self, memo: Dict = None) -> 'GridReptition': def __deepcopy__(self, memo: Dict = None) -> 'GridReptition':
memo = {} if memo is None else memo memo = {} if memo is None else memo
new = copy.copy(self) new = copy.copy(self).unlock()
new.pattern = copy.deepcopy(self.pattern, memo) new.pattern = copy.deepcopy(self.pattern, memo)
new.locked = self.locked
return new return new
# offset property # offset property

View File

@ -70,8 +70,9 @@ class SubPattern:
def __deepcopy__(self, memo: Dict = None) -> 'SubPattern': def __deepcopy__(self, memo: Dict = None) -> 'SubPattern':
memo = {} if memo is None else memo memo = {} if memo is None else memo
new = copy.copy(self) new = copy.copy(self).unlock()
new.pattern = copy.deepcopy(self.pattern, memo) new.pattern = copy.deepcopy(self.pattern, memo)
new.locked = self.locked
return new return new
# offset property # offset property