File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -509,17 +509,15 @@ def __init__(
509
509
tseg1_abr is None or tseg2_abr is None or sjw_abr is None
510
510
):
511
511
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"
515
514
)
516
515
if data_bitrate not in constants .CAN_DATABITRATE_PRESETS and (
517
516
tseg1_dbr is None or tseg2_dbr is None or sjw_dbr is None
518
517
):
519
518
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"
523
521
)
524
522
525
523
if rx_fifo_size <= 0 :
Original file line number Diff line number Diff line change @@ -396,9 +396,7 @@ def bits(n):
396
396
for b in bits (error ):
397
397
stsReturn = self .m_objPCANBasic .GetErrorText (b , 0x9 )
398
398
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"
402
400
else :
403
401
text = stsReturn [1 ].decode ("utf-8" , errors = "replace" )
404
402
You can’t perform that action at this time.
0 commit comments