only perform migrate_config parsing if it is a list
@@ -16,6 +16,7 @@ def _is_header_line(line: str) -> bool:
def _migrate_map(contents: str) -> str:
+ if isinstance(yaml_load(contents), list):
# Find the first non-header line
lines = contents.splitlines(True)
i = 0
@@ -26,7 +27,6 @@ def _migrate_map(contents: str) -> str:
header = ''.join(lines[:i])
rest = ''.join(lines[i:])
- if isinstance(yaml_load(contents), list):
# If they are using the "default" flow style of yaml, this operation
# will yield a valid configuration
try:
