summaryrefslogtreecommitdiff
path: root/tools/util.py
diff options
context:
space:
mode:
authorBert Belder <bertbelder@gmail.com>2019-09-14 15:01:29 +0200
committerBert Belder <bertbelder@gmail.com>2019-09-15 20:12:16 +0200
commitc8184eceb060fe61a6d52f75a0ec8ebe366ed432 (patch)
tree9c5ef897fae541529e47254ad350611c3fbad689 /tools/util.py
parent63e1a4cf2b6e024fcd5b8946248d78bd2fe0513c (diff)
tools: remove unused function 'find_exts()' (#2950)
Diffstat (limited to 'tools/util.py')
-rw-r--r--tools/util.py24
1 files changed, 0 insertions, 24 deletions
diff --git a/tools/util.py b/tools/util.py
index 7f5b95ea2..82465f865 100644
--- a/tools/util.py
+++ b/tools/util.py
@@ -192,30 +192,6 @@ def git_ls_files(base_dir, patterns=None):
return files
-# Recursive search for files of certain extensions.
-# * Recursive glob doesn't exist in python 2.7.
-# * On windows, `os.walk()` unconditionally follows symlinks.
-# The `skip` parameter should be used to avoid recursing through those.
-def find_exts(directories, extensions, skip=None):
- if skip is None:
- skip = []
- assert isinstance(directories, list)
- assert isinstance(extensions, list)
- skip = [os.path.normpath(i) for i in skip]
- matches = []
- for directory in directories:
- for root, dirnames, filenames in os.walk(directory):
- if root in skip:
- dirnames[:] = [] # Don't recurse further into this directory.
- continue
- for filename in filenames:
- for ext in extensions:
- if filename.endswith(ext):
- matches.append(os.path.join(root, filename))
- break
- return matches
-
-
# The Python equivalent of `rm -rf`.
def rmtree(directory):
# On Windows, shutil.rmtree() won't delete files that have a readonly bit.