scripts: logging: dictionary: utils: Fix redundant open flags

Fix issue reported by ruff.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
This commit is contained in:
Pieter De Gendt 2025-05-25 12:05:11 +02:00 committed by Benjamin Cabé
commit 3a8106b598
2 changed files with 1 additions and 4 deletions

View file

@ -568,9 +568,6 @@
"UP036", # https://docs.astral.sh/ruff/rules/outdated-version-block
"UP038", # https://docs.astral.sh/ruff/rules/non-pep604-isinstance
]
"./scripts/logging/dictionary/dictionary_parser/utils.py" = [
"UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes
]
"./scripts/logging/dictionary/log_parser.py" = [
"SIM115", # https://docs.astral.sh/ruff/rules/open-file-with-context-handler
"UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes

View file

@ -15,7 +15,7 @@ def convert_hex_file_to_bin(hexfile):
"""This converts a file in hexadecimal to binary"""
bin_data = b''
with open(hexfile, "r", encoding="iso-8859-1") as hfile:
with open(hexfile, encoding="iso-8859-1") as hfile:
for line in hfile.readlines():
hex_str = line.strip()