Skip to content

Commit

Permalink
Fix some alerts founded the LGTM system (#11966)
Browse files Browse the repository at this point in the history
Signed-off-by: Taras Drozdovskyi <[email protected]>
  • Loading branch information
tdrozdovsky authored and pull[bot] committed Aug 10, 2022
1 parent 153f4b3 commit 4457601
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 23 deletions.
4 changes: 0 additions & 4 deletions scripts/build/builders/mbed.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import logging
import os
import platform
import glob
import shlex
import pathlib

from enum import Enum, auto
from .builder import Builder
Expand Down
3 changes: 2 additions & 1 deletion scripts/tools/memory/memdf/df.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ def __init__(self, *args, **kwargs):
self[c] = pd.Series()
types = {c: self.dtype[c] for c in self.columns if c in self.dtype}
typed_columns = list(types.keys())
self[typed_columns] = self.astype(types, copy=False)[typed_columns]
self[typed_columns] = self.astype(types, copy=False)[
typed_columns] # lgtm [py/hash-unhashable-value]
self.attrs['name'] = self.name


Expand Down
2 changes: 0 additions & 2 deletions scripts/tools/memory/report_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@

import sys

import numpy # type: ignore

import memdf.collect
import memdf.report
import memdf.select
Expand Down
8 changes: 0 additions & 8 deletions src/controller/python/chip-repl.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,7 @@
#

import IPython
import chip
import chip.logging
import coloredlogs
import logging
from traitlets.config import Config
from rich import print
from rich import pretty
from rich import inspect
import builtins
import argparse
import sys

Expand Down
4 changes: 2 additions & 2 deletions src/controller/python/chip/ChipDeviceCtrl.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,11 +346,11 @@ def DeviceAvailableCallback(device, err):

# The callback might have been received synchronously (during self._ChipStack.Call()).
# Check if the device is already set before waiting for the callback.
if returnDevice.value == None:
if returnDevice.value is None:
with deviceAvailableCV:
deviceAvailableCV.wait()

if returnDevice.value == None:
if returnDevice.value is None:
raise self._ChipStack.ErrorToException(CHIP_ERROR_INTERNAL)
return returnDevice

Expand Down
3 changes: 1 addition & 2 deletions src/controller/python/chip/ChipReplStartup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import chip.clusters as Clusters
import coloredlogs
import chip.logging
import argparse
import builtins


Expand Down Expand Up @@ -41,7 +40,7 @@ def ReplInit():


def matterhelp(classOrObj=None):
if (classOrObj == None):
if (classOrObj is None):
inspect(builtins.devCtrl, methods=True, help=True, private=False)
else:
inspect(classOrObj, methods=True, help=True, private=False)
Expand Down
4 changes: 2 additions & 2 deletions src/controller/python/chip/clusters/Attribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
from asyncio.futures import Future
import ctypes
from dataclasses import dataclass
from typing import Type, Union, List, Any
from ctypes import CFUNCTYPE, c_char_p, c_size_t, c_void_p, c_uint32, c_uint16, py_object
from typing import Union, List, Any
from ctypes import CFUNCTYPE, c_char_p, c_size_t, c_uint32, c_uint16, py_object

from .ClusterObjects import ClusterAttributeDescriptor
import chip.exceptions
Expand Down
2 changes: 1 addition & 1 deletion src/controller/python/chip/clusters/Command.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def _handleResponse(self, path: CommandPath, status: Status, response: bytes):
self._future.set_result(None)
else:
# If a type hasn't been assigned, let's auto-deduce it.
if (self._expect_type == None):
if (self._expect_type is None):
self._expect_type = FindCommandClusterObject(False, path)

if self._expect_type:
Expand Down
2 changes: 1 addition & 1 deletion src/controller/python/chip/interaction_model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

from chip.exceptions import ChipStackException

__all__ = ["IMDelegate", "Status", "InteractionModelError"]
__all__ = ["Status", "InteractionModelError"]


class Status(enum.IntEnum):
Expand Down

0 comments on commit 4457601

Please sign in to comment.