From: Martin v. Löwis Date: Fri, 6 Aug 2010 10:43:31 +0000 (+0000) Subject: Change pyc removal to support __pycache__. X-Git-Tag: v3.2a2~453 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2e3d539ce2d4b91e3353e890858f8f8de6215d25;p=python Change pyc removal to support __pycache__. --- diff --git a/Tools/msi/msilib.py b/Tools/msi/msilib.py index 38fef8c54a..8f739341a3 100644 --- a/Tools/msi/msilib.py +++ b/Tools/msi/msilib.py @@ -583,10 +583,17 @@ class Directory: return files def remove_pyc(self): - "Remove .pyc/.pyo files on uninstall" + "Remove .pyc/.pyo files from __pycache__ on uninstall" + directory = self.logical + "_pycache" + add_data(self.db, "Directory", [(directory, self.logical, "__PYCA~1|__pycache__")]) + flags = 256 if Win64 else 0 + add_data(self.db, "Component", + [(directory, gen_uuid(), directory, flags, None, None)]) + add_data(self.db, "FeatureComponents", [(current_feature.id, directory)]) + add_data(self.db, "CreateFolder", [(directory, directory)]) add_data(self.db, "RemoveFile", - [(self.component+"c", self.component, "*.pyc", self.logical, 2), - (self.component+"o", self.component, "*.pyo", self.logical, 2)]) + [(self.component, self.component, "*.*", directory, 2), + ]) def removefile(self, key, pattern): "Add a RemoveFile entry"