Python 3.5 adjustments (#13173)

This commit is contained in:
Otto Winter
2018-03-15 12:10:54 +01:00
committed by Johann Kellerman
parent 6909be1cc7
commit 27c1806897
6 changed files with 11 additions and 23 deletions

View File

@@ -95,9 +95,12 @@ def run(script_args: List) -> int:
if args.files:
print(color(C_HEAD, 'yaml files'), '(used /',
color('red', 'not used') + ')')
# Python 3.5 gets a recursive, but not in 3.4
for yfn in sorted(glob(os.path.join(config_dir, '*.yaml')) +
glob(os.path.join(config_dir, '*/*.yaml'))):
deps = os.path.join(config_dir, 'deps')
yaml_files = [f for f in glob(os.path.join(config_dir, '**/*.yaml'),
recursive=True)
if not f.startswith(deps)]
for yfn in sorted(yaml_files):
the_color = '' if yfn in res['yaml_files'] else 'red'
print(color(the_color, '-', yfn))