Enable the yield-in-for-loop ruff rule and fix warnings (#2984)
This commit is contained in:
parent
af043afa88
commit
8fa5ec15af
|
|
@ -80,8 +80,7 @@ class Boot:
|
|||
|
||||
def __iter__(self) -> Iterator[bytes]:
|
||||
if self.session:
|
||||
for value in self.session:
|
||||
yield value
|
||||
yield from self.session
|
||||
|
||||
def __contains__(self, key: bytes) -> bool:
|
||||
if self.session is None:
|
||||
|
|
|
|||
|
|
@ -383,8 +383,7 @@ class SysCommand:
|
|||
|
||||
def __iter__(self, *args: list[Any], **kwargs: dict[str, Any]) -> Iterator[bytes]:
|
||||
if self.session:
|
||||
for line in self.session:
|
||||
yield line
|
||||
yield from self.session
|
||||
|
||||
def __getitem__(self, key: slice) -> bytes | None:
|
||||
if not self.session:
|
||||
|
|
|
|||
|
|
@ -211,7 +211,6 @@ ignore = [
|
|||
"RUF012", # mutable-class-default
|
||||
"RUF015", # unnecessary-iterable-allocation-for-first-element
|
||||
"RUF039", # unraw-re-pattern
|
||||
"UP028", # yield-in-for-loop
|
||||
"UP037", # quoted-annotation
|
||||
"W191", # tab-indentation
|
||||
]
|
||||
|
|
|
|||
Loading…
Reference in New Issue