]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
practracker: Don't read editor temp files, attempt 2
authorteor <teor@torproject.org>
Thu, 14 Nov 2019 06:12:19 +0000 (16:12 +1000)
committerteor <teor@torproject.org>
Thu, 14 Nov 2019 06:12:19 +0000 (16:12 +1000)
(Or any files that start with "." or "#".)

Obviously correct changes to already-reviewed code.

scripts/maint/practracker/util.py

index c38e4c8dd06be48f87fd855a57cc62c14e88050c..db02a983f82eede2975cf3e1b6a9793fe5e8baa6 100644 (file)
@@ -33,10 +33,13 @@ def get_tor_c_files(tor_topdir, include_dirs=None):
                 # We only care about .c and .h files
                 if not (filename.endswith(".c") or filename.endswith(".h")):
                     continue
+                if filename in EXCLUDE_FILES:
+                    continue
                 # Avoid editor temporary files
-                if filename.startswith("."):
+                bname = os.path.basename(filename)
+                if bname.startswith("."):
                     continue
-                if filename in EXCLUDE_FILES:
+                if bname.startswith("#"):
                     continue
 
                 full_path = os.path.join(root,filename)