python-can
python-can copied to clipboard
Increase the usage of augmented assignment statements
:eyes: Some source code analysis tools can help to find opportunities for improving software components. :thought_balloon: I propose to increase the usage of augmented assignment statements accordingly.
diff --git a/can/interfaces/gs_usb.py b/can/interfaces/gs_usb.py
index 447cdf4..3c619d6 100644
--- a/can/interfaces/gs_usb.py
+++ b/can/interfaces/gs_usb.py
@@ -44,13 +44,13 @@ class GsUsbBus(can.BusABC):
can_id = msg.arbitration_id
if msg.is_extended_id:
- can_id = can_id | CAN_EFF_FLAG
+ can_id |= CAN_EFF_FLAG
if msg.is_remote_frame:
- can_id = can_id | CAN_RTR_FLAG
+ can_id |= CAN_RTR_FLAG
if msg.is_error_frame:
- can_id = can_id | CAN_ERR_FLAG
+ can_id |= CAN_ERR_FLAG
# Pad message data
msg.data.extend([0x00] * (CAN_MAX_DLC - len(msg.data)))
diff --git a/can/interfaces/usb2can/serial_selector.py b/can/interfaces/usb2can/serial_selector.py
index fcc9512..a4e96b9 100644
--- a/can/interfaces/usb2can/serial_selector.py
+++ b/can/interfaces/usb2can/serial_selector.py
@@ -18,9 +18,9 @@ def WMIDateStringToDate(dtmDate) -> str:
strDateTime = dtmDate[4] + dtmDate[5] + "/"
if dtmDate[6] == 0:
- strDateTime = strDateTime + dtmDate[7] + "/"
+ strDateTime += dtmDate[7] + "/"
else:
- strDateTime = strDateTime + dtmDate[6] + dtmDate[7] + "/"
+ strDateTime += dtmDate[6] + dtmDate[7] + "/"
strDateTime = (
strDateTime
+ dtmDate[0]