Use pathlib Path.glob instead of glob.glob(recursive=True)

recursive option in glob.glob is supported from 3.5, so use Path.glob
instaed

Bug: 138639389
Test: development/vndk/tools/image-diff-tool/compare_images_and_print.sh "-t path1 path2 -s SYSTEM -i
"

Change-Id: If184b15e1b0be2a80f2f79a281b5093ad177eb6c
This commit is contained in:
Jeongik Cha
2019-08-05 15:30:02 +09:00
parent 4b03e176a6
commit 717fdcd8a0

View File

@@ -17,7 +17,7 @@ import os
import subprocess
import sys
from collections import defaultdict
from glob import glob
from pathlib import Path
from operator import itemgetter
import hashlib
import argparse
@@ -69,8 +69,7 @@ def main(all_targets, search_paths, ignore_signing_key=False):
if os.path.join(target, s).lower() + os.path.sep in p.lower():
return True
return False
paths = [path for path in glob(os.path.join(
target, "**", "*"), recursive=True) if valid_path(path)]
paths = [path for path in Path(target).glob('**/*') if valid_path(path)]
def run(path):
is_native_component = silent_call(["objdump", "-a", path])