Changed from open() to io.open()

This commit is contained in:
roottool 2019-04-22 03:48:18 +09:00
parent e6e26c3110
commit e7924b53e4

View file

@ -3,6 +3,7 @@ from __future__ import print_function
import argparse import argparse
import collections import collections
import sys import sys
import io
from typing import Any from typing import Any
from typing import Generator from typing import Generator
from typing import Optional from typing import Optional
@ -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)