From d6247cad75664cc9f1276e8c345d50ec3e91b06e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20Bal=C3=A1=C5=BEik?= Date: Sat, 21 Feb 2026 11:46:33 +0100 Subject: [PATCH] Fix 'Using deprecated class FileType of module argparse' In preparation for running pylint on more Python code. --- bin/tests/system/convert-junit-to-trs.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/tests/system/convert-junit-to-trs.py b/bin/tests/system/convert-junit-to-trs.py index 9675825a50..3726e19fb5 100755 --- a/bin/tests/system/convert-junit-to-trs.py +++ b/bin/tests/system/convert-junit-to-trs.py @@ -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))