Skip to content

Commit

Permalink
Merge pull request #378 from roottool/change-from-open-to-io.open#377
Browse files Browse the repository at this point in the history
Changed from open() to io.open()
  • Loading branch information
asottile authored Apr 21, 2019
2 parents e6e26c3 + fc9fb8b commit f677478
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pre_commit_hooks/check_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

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

0 comments on commit f677478

Please sign in to comment.