Fix 'Using deprecated class FileType of module argparse'

In preparation for running pylint on more Python code.
This commit is contained in:
Štěpán Balážik 2026-02-21 11:46:33 +01:00
parent 7dd6b4dc5b
commit d6247cad75

View file

@ -7,6 +7,7 @@
# Convert JUnit pytest output to automake .trs files
import argparse
from pathlib import Path
import sys
from xml.etree import ElementTree
@ -57,12 +58,13 @@ def main():
)
parser.add_argument(
"junit_file",
type=argparse.FileType("r", encoding="utf-8"),
type=Path,
help="junit xml result file",
)
args = parser.parse_args()
junit_xml = args.junit_file.read()
with args.junit_file.open(encoding="utf-8") as junit_file:
junit_xml = junit_file.read()
sys.exit(junit_to_trs(junit_xml))