Changed from open() to io.open()
This commit is contained in:
Anthony Sottile 2019-04-21 12:36:48 -07:00 committed by GitHub
commit f67747875e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,6 +2,7 @@ from __future__ import print_function
import argparse import argparse
import collections import collections
import io
import sys import sys
from typing import Any from typing import Any
from typing import Generator from typing import Generator
@ -58,7 +59,7 @@ def main(argv=None): # type: (Optional[Sequence[str]]) -> int
retval = 0 retval = 0
for filename in args.filenames: for filename in args.filenames:
try: try:
with open(filename) as f: with io.open(filename, encoding='UTF-8') as f:
load_fn(f) load_fn(f)
except ruamel.yaml.YAMLError as exc: except ruamel.yaml.YAMLError as exc:
print(exc) print(exc)