]> granicus.if.org Git - python/commitdiff
Change pyc removal to support __pycache__.
authorMartin v. Löwis <martin@v.loewis.de>
Fri, 6 Aug 2010 10:43:31 +0000 (10:43 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Fri, 6 Aug 2010 10:43:31 +0000 (10:43 +0000)
Tools/msi/msilib.py

index 38fef8c54a18221a1ac07f0407b1307ddc235b4e..8f739341a3d0932b4251bd7d233b249c4849a567 100644 (file)
@@ -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"