mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-05 11:36:54 +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()
|
||||
for filename in args.filenames:
|
||||
try:
|
||||
with open(filename, 'rb') as xml_file:
|
||||
xml.sax.parse(xml_file, handler)
|
||||
xml.sax.parse(filename, handler)
|
||||
except xml.sax.SAXException as exc:
|
||||
print(f'{filename}: Failed to xml parse ({exc})')
|
||||
retval = 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue