Skip to content

Commit 65d9fe0

Browse files
committed
make ruff happy
1 parent 65bde81 commit 65d9fe0

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

can/interfaces/ixxat/canlib_vcinpl2.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -509,17 +509,15 @@ def __init__(
509509
tseg1_abr is None or tseg2_abr is None or sjw_abr is None
510510
):
511511
raise ValueError(
512-
"To use bitrate {} (that has not predefined preset) is mandatory to use also parameters tseg1_abr, tseg2_abr and swj_abr".format(
513-
bitrate
514-
)
512+
f"To use bitrate {bitrate} (that has not predefined preset) is mandatory "
513+
f"to use also parameters tseg1_abr, tseg2_abr and swj_abr"
515514
)
516515
if data_bitrate not in constants.CAN_DATABITRATE_PRESETS and (
517516
tseg1_dbr is None or tseg2_dbr is None or sjw_dbr is None
518517
):
519518
raise ValueError(
520-
"To use data_bitrate {} (that has not predefined preset) is mandatory to use also parameters tseg1_dbr, tseg2_dbr and swj_dbr".format(
521-
data_bitrate
522-
)
519+
f"To use data_bitrate {data_bitrate} (that has not predefined preset) is mandatory "
520+
f"to use also parameters tseg1_dbr, tseg2_dbr and swj_dbr"
523521
)
524522

525523
if rx_fifo_size <= 0:

can/interfaces/pcan/pcan.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,9 +396,7 @@ def bits(n):
396396
for b in bits(error):
397397
stsReturn = self.m_objPCANBasic.GetErrorText(b, 0x9)
398398
if stsReturn[0] != PCAN_ERROR_OK:
399-
text = "An error occurred. Error-code's text ({:X}h) couldn't be retrieved".format(
400-
error
401-
)
399+
text = f"An error occurred. Error-code's text ({error:X}h) couldn't be retrieved"
402400
else:
403401
text = stsReturn[1].decode("utf-8", errors="replace")
404402

0 commit comments

Comments
 (0)