mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-08 20:44:18 +00:00
pytype: pass str filename to xml.sax.parse, not BinaryIO
This commit is contained in:
parent
3d379a962d
commit
846dd4f6dd
1 changed files with 1 additions and 2 deletions
|
|
@ -13,8 +13,7 @@ def main(argv: Optional[Sequence[str]] = None) -> int:
|
||||||
handler = xml.sax.handler.ContentHandler()
|
handler = xml.sax.handler.ContentHandler()
|
||||||
for filename in args.filenames:
|
for filename in args.filenames:
|
||||||
try:
|
try:
|
||||||
with open(filename, 'rb') as xml_file:
|
xml.sax.parse(filename, handler)
|
||||||
xml.sax.parse(xml_file, handler)
|
|
||||||
except xml.sax.SAXException as exc:
|
except xml.sax.SAXException as exc:
|
||||||
print(f'{filename}: Failed to xml parse ({exc})')
|
print(f'{filename}: Failed to xml parse ({exc})')
|
||||||
retval = 1
|
retval = 1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue