Fixed an issue in the cleanup script. 6_1_x

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

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 19 Jul 2016 18:51:15 +0200
branch
6_1_x
changeset 5043
a4044e648b75
parent 5026
2ef5c7ec95c2
child 5052
6803b3fcc4c9

Fixed an issue in the cleanup script.
(grafted from 021d99e039611f78c9223e34069ce83a1c4661a4)

cleanupSource.py file | annotate | diff | comparison | revisions
diff -r 2ef5c7ec95c2 -r a4044e648b75 cleanupSource.py
--- a/cleanupSource.py	Sun Jul 10 12:48:18 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