1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

[opt-diff] Fix the case when the script is invoked with directories

llvm-svn: 297055
This commit is contained in:
Adam Nemet 2017-03-06 19:15:22 +00:00
parent 36a3960cd7
commit 056c20b496

View File

@ -21,6 +21,7 @@ import argparse
from collections import defaultdict
from multiprocessing import cpu_count, Pool
import os, os.path
import fnmatch
def find_files(dir_or_file):
if os.path.isfile(dir_or_file):
@ -29,7 +30,8 @@ def find_files(dir_or_file):
all = []
for dir, subdirs, files in os.walk(dir_or_file):
for file in files:
all.append( os.path.join(dir, file))
if fnmatch.fnmatch(file, "*.opt.yaml"):
all.append( os.path.join(dir, file))
return all
if __name__ == '__main__':