mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
Fix 'Using deprecated class FileType of module argparse'
In preparation for running pylint on more Python code.
This commit is contained in:
parent
7dd6b4dc5b
commit
d6247cad75
1 changed files with 4 additions and 2 deletions
|
|
@ -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))
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue