From: Zac Medico Date: Fri, 27 Aug 2010 01:04:14 +0000 (-0700) Subject: Make LicenseManager.__deepcopy__() do a shallow copy of _license_groups X-Git-Tag: v2.2_rc70~38 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2cdbbf07b13e5ec0d7f033ed6bbdae57235f9158;p=portage.git Make LicenseManager.__deepcopy__() do a shallow copy of _license_groups since internal policy ensures lack of mutation, and fix memo usage for the other immutable attributes. --- diff --git a/pym/portage/package/ebuild/_config/LicenseManager.py b/pym/portage/package/ebuild/_config/LicenseManager.py index c70344538..4ce1123b0 100644 --- a/pym/portage/package/ebuild/_config/LicenseManager.py +++ b/pym/portage/package/ebuild/_config/LicenseManager.py @@ -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