Skip to content

Commit

Permalink
Revert "Fix some alerts from the LGTM system (#11143)" (#11436)
Browse files Browse the repository at this point in the history
This reverts commit 3504fc1.

That commit seems to have broken cirque.
  • Loading branch information
andy31415 authored and pull[bot] committed Apr 25, 2022
1 parent ad0b3eb commit 3592312
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 17 deletions.
3 changes: 1 addition & 2 deletions scripts/tools/memory/memdf/df.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ 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] # lgtm [py/hash-unhashable-value]
self[typed_columns] = self.astype(types, copy=False)[typed_columns]
self.attrs['name'] = self.name


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

import sys

import numpy # type: ignore

import memdf.collect
import memdf.report
import memdf.select
Expand Down
2 changes: 1 addition & 1 deletion src/controller/python/chip/ChipBleUtility.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

from __future__ import absolute_import
from __future__ import print_function
from ctypes import * # lgtm [py/polluting-import]
from ctypes import *
from .ChipUtility import ChipUtility


Expand Down
2 changes: 1 addition & 1 deletion src/controller/python/chip/ChipBluezMgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import uuid
import queue

from ctypes import CFUNCTYPE, PYFUNCTYPE, c_void_p, c_int
from ctypes import *

try:
from gi.repository import GObject
Expand Down
2 changes: 1 addition & 1 deletion src/controller/python/chip/ChipCommissionableNodeCtrl.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

from __future__ import absolute_import
from __future__ import print_function
from ctypes import c_void_p, c_uint32
from ctypes import *
from .ChipStack import *
from .exceptions import *

Expand Down
2 changes: 1 addition & 1 deletion src/controller/python/chip/ChipCoreBluetoothMgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

from __future__ import absolute_import
from __future__ import print_function
from ctypes import * # lgtm [py/polluting-import]
from ctypes import *
from Foundation import *

import logging
Expand Down
6 changes: 3 additions & 3 deletions src/controller/python/chip/ChipDeviceCtrl.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from __future__ import absolute_import
from __future__ import print_function
import asyncio
from ctypes import * # lgtm [py/polluting-import]
from ctypes import *
from .ChipStack import *
from .interaction_model import delegate as im
from .exceptions import *
Expand Down Expand Up @@ -334,11 +334,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 is None:
if returnDevice.value == None:
with deviceAvailableCV:
deviceAvailableCV.wait()

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

Expand Down
2 changes: 1 addition & 1 deletion src/controller/python/chip/ChipStack.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import platform
import logging
from threading import Lock, Event, Condition
from ctypes import * # lgtm [py/polluting-import]
from ctypes import *
from .ChipUtility import ChipUtility
from .exceptions import *

Expand Down
2 changes: 1 addition & 1 deletion src/controller/python/chip/ChipUtility.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from __future__ import absolute_import
from __future__ import print_function
import binascii
from ctypes import c_void_p, c_byte
from ctypes import *


class ChipUtility(object):
Expand Down
2 changes: 1 addition & 1 deletion src/controller/python/chip/ble/library_handle.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#

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

Expand Down
4 changes: 2 additions & 2 deletions src/controller/python/chip/clusters/Command.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#

from asyncio.futures import Future
import ctypes # lgtm [py/import-and-import-from]
import ctypes
from dataclasses import dataclass
from typing import Type
from ctypes import CFUNCTYPE, c_char_p, c_size_t, c_void_p, c_uint32, c_uint16, c_uint8, py_object
Expand Down 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 is None):
if (self._expect_type == None):
self._expect_type = FindCommandClusterObject(False, path)

if self._expect_type:
Expand Down
2 changes: 1 addition & 1 deletion src/controller/python/chip/clusters/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
"""Provides Python APIs for CHIP."""
from . import Command
from . import Attribute
from .Objects import * # lgtm [py/polluting-import]
from .Objects import *
from . import CHIPClusters
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__ = ["Status", "InteractionModelError"]
__all__ = ["IMDelegate", "Status", "InteractionModelError"]


class Status(enum.IntEnum):
Expand Down
2 changes: 1 addition & 1 deletion src/controller/python/chip/interaction_model/delegate.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from abc import abstractmethod
from construct import Struct, Int64ul, Int32ul, Int16ul, Int8ul
from ctypes import CFUNCTYPE, c_void_p, c_uint32, c_uint64, c_uint8, c_uint16, c_ssize_t
import ctypes # lgtm [py/import-and-import-from]
import ctypes
import chip.native
import threading
import chip.tlv
Expand Down

0 comments on commit 3592312

Please sign in to comment.