Make LicenseManager.__deepcopy__() do a shallow copy of _license_groups
authorZac Medico <zmedico@gentoo.org>
Fri, 27 Aug 2010 01:04:14 +0000 (18:04 -0700)
committerZac Medico <zmedico@gentoo.org>
Fri, 27 Aug 2010 01:04:14 +0000 (18:04 -0700)
since internal policy ensures lack of mutation, and fix memo usage
for the other immutable attributes.

pym/portage/package/ebuild/_config/LicenseManager.py

index c70344538f9d6c819f669dea291b54fe9e9747b0..4ce1123b059e12d5c3cab5a94504767789fc2a2a 100644 (file)
@@ -37,11 +37,16 @@ class LicenseManager(object):
 
                # immutable attributes
                result._accept_license_str = self._accept_license_str
+               memo[id(self._accept_license_str)] = self._accept_license_str
                result._accept_license = self._accept_license
+               memo[id(self._accept_license)] = self._accept_license
+
+               # immutable attributes (internal policy ensures lack of mutation)
+               result._license_groups = self._license_groups
+               memo[id(self._license_groups)] = self._license_groups
 
                # mutable attributes
                result._plicensedict = deepcopy(self._plicensedict, memo)
-               result._license_groups = deepcopy(self._license_groups, memo)
                result._undef_lic_groups = deepcopy(self._undef_lic_groups, memo)
 
                return result