diff --git a/src/controller/python/chip/ChipBleUtility.py b/src/controller/python/chip/ChipBleUtility.py index e83bebb9ac8cd6..410475042bcdae 100644 --- a/src/controller/python/chip/ChipBleUtility.py +++ b/src/controller/python/chip/ChipBleUtility.py @@ -368,7 +368,7 @@ def __init__(self, pairingState, discriminator, vendorId, productId): def ParseServiceData(data): - if len(data) is not SERVICE_DATA_LEN: + if len(data) != SERVICE_DATA_LEN: return None return BleDeviceIdentificationInfo( int(data[0]), diff --git a/src/controller/python/chip/ChipDeviceCtrl.py b/src/controller/python/chip/ChipDeviceCtrl.py index 779c2d9c5c3e56..aa15c602c6f75f 100644 --- a/src/controller/python/chip/ChipDeviceCtrl.py +++ b/src/controller/python/chip/ChipDeviceCtrl.py @@ -295,7 +295,7 @@ def HandlePASEEstablishmentComplete(err: PyChipError): else: print("Established secure session with Device") - if self.state is not DCState.COMMISSIONING: + if self.state != DCState.COMMISSIONING: # During Commissioning, HandlePASEEstablishmentComplete will also be called, # in this case the async operation should be marked as finished by # HandleCommissioningComplete instead this function. diff --git a/src/controller/python/chip/tlv/__init__.py b/src/controller/python/chip/tlv/__init__.py index 62894812fa47ea..d24569618fb008 100644 --- a/src/controller/python/chip/tlv/__init__.py +++ b/src/controller/python/chip/tlv/__init__.py @@ -359,7 +359,7 @@ def _encodeControlAndTag(self, type, tag, lenOfLenOrVal=0): controlByte |= 3 if tag is None: if ( - type is not TLVEndOfContainer + type != TLVEndOfContainer and len(self._containerStack) != 0 and self._containerStack[0] == TLV_TYPE_STRUCTURE ): @@ -443,9 +443,9 @@ def _encodeUnsignedInt(val): @staticmethod def _verifyValidContainerType(containerType): if ( - containerType is not TLV_TYPE_STRUCTURE - and containerType is not TLV_TYPE_ARRAY - and containerType is not TLV_TYPE_PATH + containerType != TLV_TYPE_STRUCTURE + and containerType != TLV_TYPE_ARRAY + and containerType != TLV_TYPE_PATH ): raise ValueError("Invalid TLV container type")