Fixed an issue in the cleanup script.

Tue, 19 Jul 2016 18:51:15 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 19 Jul 2016 18:51:15 +0200
changeset 5042
021d99e03961
parent 5040
73c784b7b3bc
child 5047
04e5dfbd3f3d

Fixed an issue in the cleanup script.

cleanupSource.py file | annotate | diff | comparison | revisions
--- a/cleanupSource.py	Mon Jul 18 19:09:59 2016 +0200
+++ b/cleanupSource.py	Tue Jul 19 18:51:15 2016 +0200
@@ -35,10 +35,11 @@
             if os.path.exists(os.path.join(dirName, sourceName + "c")):
                 os.remove(os.path.join(dirName, sourceName + "c"))
     
-    # step 2: delete the __pycache__ directory and all *.pyc files
+    # step 2: delete the __pycache__ directory and all remaining *.pyc files
     if os.path.exists(os.path.join(dirName, "__pycache__")):
         shutil.rmtree(os.path.join(dirName, "__pycache__"))
-    for name in [f for f in dirListing if fnmatch.fnmatch(f, "*.pyc")]:
+    for name in [f for f in os.listdir(dirName)
+                 if fnmatch.fnmatch(f, "*.pyc")]:
         os.remove(os.path.join(dirName, name))
     
     # step 3: descent into subdirectories and delete them if empty

eric ide

mercurial