Skip to content

Commit 40dbff5

Browse files
tdrozdovskypull[bot]
authored andcommitted
Fix some alerts from the LGTM system (#11143)
Signed-off-by: Taras Drozdovskyi <[email protected]>
1 parent c9585b7 commit 40dbff5

14 files changed

+17
-18
lines changed

scripts/tools/memory/memdf/df.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ def __init__(self, *args, **kwargs):
3232
self[c] = pd.Series()
3333
types = {c: self.dtype[c] for c in self.columns if c in self.dtype}
3434
typed_columns = list(types.keys())
35-
self[typed_columns] = self.astype(types, copy=False)[typed_columns]
35+
self[typed_columns] = self.astype(types, copy=False)[
36+
typed_columns] # lgtm [py/hash-unhashable-value]
3637
self.attrs['name'] = self.name
3738

3839

scripts/tools/memory/report_summary.py

-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828

2929
import sys
3030

31-
import numpy # type: ignore
32-
3331
import memdf.collect
3432
import memdf.report
3533
import memdf.select

src/controller/python/chip/ChipBleUtility.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
from __future__ import absolute_import
2626
from __future__ import print_function
27-
from ctypes import *
27+
from ctypes import * # lgtm [py/polluting-import]
2828
from .ChipUtility import ChipUtility
2929

3030

src/controller/python/chip/ChipBluezMgr.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import uuid
3636
import queue
3737

38-
from ctypes import *
38+
from ctypes import CFUNCTYPE, PYFUNCTYPE, c_void_p, c_int
3939

4040
try:
4141
from gi.repository import GObject

src/controller/python/chip/ChipCommissionableNodeCtrl.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
from __future__ import absolute_import
2727
from __future__ import print_function
28-
from ctypes import *
28+
from ctypes import c_void_p, c_uint32
2929
from .ChipStack import *
3030
from .exceptions import *
3131

src/controller/python/chip/ChipCoreBluetoothMgr.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
from __future__ import absolute_import
2626
from __future__ import print_function
27-
from ctypes import *
27+
from ctypes import * # lgtm [py/polluting-import]
2828
from Foundation import *
2929

3030
import logging

src/controller/python/chip/ChipDeviceCtrl.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from __future__ import absolute_import
2929
from __future__ import print_function
3030
import asyncio
31-
from ctypes import *
31+
from ctypes import * # lgtm [py/polluting-import]
3232
from .ChipStack import *
3333
from .interaction_model import delegate as im
3434
from .exceptions import *
@@ -334,11 +334,11 @@ def DeviceAvailableCallback(device, err):
334334

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

341-
if returnDevice.value == None:
341+
if returnDevice.value is None:
342342
raise self._ChipStack.ErrorToException(CHIP_ERROR_INTERNAL)
343343
return returnDevice
344344

src/controller/python/chip/ChipStack.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
import platform
3434
import logging
3535
from threading import Lock, Event, Condition
36-
from ctypes import *
36+
from ctypes import * # lgtm [py/polluting-import]
3737
from .ChipUtility import ChipUtility
3838
from .exceptions import *
3939

src/controller/python/chip/ChipUtility.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from __future__ import absolute_import
2525
from __future__ import print_function
2626
import binascii
27-
from ctypes import *
27+
from ctypes import c_void_p, c_byte
2828

2929

3030
class ChipUtility(object):

src/controller/python/chip/ble/library_handle.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#
1616

1717
import chip.native
18-
import ctypes
18+
import ctypes # lgtm [py/import-and-import-from]
1919
from ctypes import c_bool, c_void_p, c_char_p, c_uint32, py_object
2020
from chip.ble.types import DeviceScannedCallback, ScanDoneCallback
2121

src/controller/python/chip/clusters/Command.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#
1717

1818
from asyncio.futures import Future
19-
import ctypes
19+
import ctypes # lgtm [py/import-and-import-from]
2020
from dataclasses import dataclass
2121
from typing import Type
2222
from ctypes import CFUNCTYPE, c_char_p, c_size_t, c_void_p, c_uint32, c_uint16, c_uint8, py_object
@@ -74,7 +74,7 @@ def _handleResponse(self, path: CommandPath, status: Status, response: bytes):
7474
self._future.set_result(None)
7575
else:
7676
# If a type hasn't been assigned, let's auto-deduce it.
77-
if (self._expect_type == None):
77+
if (self._expect_type is None):
7878
self._expect_type = FindCommandClusterObject(False, path)
7979

8080
if self._expect_type:

src/controller/python/chip/clusters/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@
2323
"""Provides Python APIs for CHIP."""
2424
from . import Command
2525
from . import Attribute
26-
from .Objects import *
26+
from .Objects import * # lgtm [py/polluting-import]
2727
from . import CHIPClusters

src/controller/python/chip/interaction_model/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
from chip.exceptions import ChipStackException
2828

29-
__all__ = ["IMDelegate", "Status", "InteractionModelError"]
29+
__all__ = ["Status", "InteractionModelError"]
3030

3131

3232
class Status(enum.IntEnum):

src/controller/python/chip/interaction_model/delegate.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from abc import abstractmethod
1818
from construct import Struct, Int64ul, Int32ul, Int16ul, Int8ul
1919
from ctypes import CFUNCTYPE, c_void_p, c_uint32, c_uint64, c_uint8, c_uint16, c_ssize_t
20-
import ctypes
20+
import ctypes # lgtm [py/import-and-import-from]
2121
import chip.native
2222
import threading
2323
import chip.tlv

0 commit comments

Comments
 (0)