- try:
- with open(filepath) as fh:
- rdt_yml = yaml.load(fh)
- except Exception as e:
- invalid_nesting.append(filepath)
- print(e)
- invalid_nesting.extend(
- check_for_invalid_nesting(rdt_yml,
- filepath,
- dirpath))
+ else:
+ continue
+ else:
+ continue
+ try:
+ with open(filepath) as fh:
+ yml = yaml.load(fh)
+ except yaml.YAMLError as e:
+ invalid_nesting.append(filepath)
+ print(e) # pylint: disable=superfluous-parens
+ invalid_nesting.extend(check_for_invalid_nesting(
+ yml,
+ filepath,
+ dirpath))