From 2cdbbf07b13e5ec0d7f033ed6bbdae57235f9158 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 26 Aug 2010 18:04:14 -0700 Subject: 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. --- pym/portage/package/ebuild/_config/LicenseManager.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'pym') 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 -- cgit v1.2.3-1-g7c22