diff --git a/Lib/fontParts/base/base.py b/Lib/fontParts/base/base.py index abba04f5..f1fd9200 100644 --- a/Lib/fontParts/base/base.py +++ b/Lib/fontParts/base/base.py @@ -216,8 +216,7 @@ def copyData(self, source): if isinstance(selfValue, BaseObject): selfValue.copyData(sourceValue) else: - setattr(self, attr, sourceValue) - + setattr(self, attr, deepcopy(sourceValue)) # ---------- # Exceptions # ---------- @@ -832,10 +831,10 @@ def _setIdentifier(self, value): def reference(obj): """ This code returns a simple function that returns the given object. - This is a backwards compatibility function that is under review. - See #749. We used to use weak references, but they proved - problematic (see issue #71), so this function was put in place to - make sure existing code continued to function. The need for it is + This is a backwards compatibility function that is under review. + See #749. We used to use weak references, but they proved + problematic (see issue #71), so this function was put in place to + make sure existing code continued to function. The need for it is questionable, so it may be deleted soon. """ def wrapper(): diff --git a/Lib/fontParts/test/test_info.py b/Lib/fontParts/test/test_info.py index b5aa63d7..bbdf6e77 100644 --- a/Lib/fontParts/test/test_info.py +++ b/Lib/fontParts/test/test_info.py @@ -122,6 +122,18 @@ def test_update(self): self.assertEqual(info1.familyName, "test2") self.assertEqual(info1.unitsPerEm, 2000) + # ---- + # Copy + # ---- + def test_copy(self): + info1 = self.getInfo_generic() + info1.postscriptBlueValues = [-10, 0, 50, 60] + + info2 = info1.copy() + info2.postscriptBlueValues[0] = -2 + + self.assertNotEqual(info1.postscriptBlueValues, info2.postscriptBlueValues) + # ------------- # Interpolation # -------------