mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-07 20:26:54 +00:00
Merge pull request #378 from roottool/change-from-open-to-io.open#377
Changed from open() to io.open()
This commit is contained in:
commit
f67747875e
1 changed files with 2 additions and 1 deletions
|
|
@ -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)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue