Skip to content

Commit

Permalink
Fix pylint Regression
Browse files Browse the repository at this point in the history
  • Loading branch information
sdimitro committed Nov 5, 2024
1 parent 92fc92b commit a2495a6
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion sdb/commands/echo.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def _init_parser(cls, name: str) -> argparse.ArgumentParser:

def _call(self, objs: Iterable[drgn.Object]) -> Iterable[drgn.Object]:
for obj in objs:
yield obj
yield from obj

for addr in self.args.addrs:
try:
Expand Down
2 changes: 1 addition & 1 deletion sdb/commands/linux/internal/slub_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def util(cache: drgn.Object) -> int:

def lookup_cache_by_address(obj: drgn.Object) -> Optional[drgn.Object]:
try:
cache = find_containing_slab_cache(obj)
cache = find_containing_slab_cache(prog=sdb.get_prog(), addr=obj)
if cache.value_() == 0x0:
return None
return cache
Expand Down
4 changes: 2 additions & 2 deletions sdb/commands/linux/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def _init_parser(cls, name: str) -> argparse.ArgumentParser:

def _call(self, objs: Iterable[drgn.Object]) -> Iterable[drgn.Object]:
for pid in self.args.pid:
yield find_pid(sdb.get_prog(), pid)
yield find_pid(prog=sdb.get_prog(), ns=sdb.get_prog(), pid=pid)


class FindTask(sdb.Command):
Expand Down Expand Up @@ -90,4 +90,4 @@ def _init_parser(cls, name: str) -> argparse.ArgumentParser:

def _call(self, objs: Iterable[drgn.Object]) -> Iterable[drgn.Object]:
for pid in self.args.pid:
yield find_task(sdb.get_prog(), pid)
yield find_task(prog=sdb.get_prog(), ns=sdb.get_prog(), pid=pid)
2 changes: 1 addition & 1 deletion sdb/commands/linux/stacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ def pretty_print(self, objs: Iterable[drgn.Object]) -> None:

def no_input(self) -> Iterable[drgn.Object]:
self.validate_context()
yield from filter(self.match_stack, for_each_task(sdb.get_prog()))
yield from filter(self.match_stack, for_each_task(prog=sdb.get_prog(), ns=sdb.get_prog()))


class KernelCrashedThread(sdb.Locator, sdb.PrettyPrinter):
Expand Down
2 changes: 1 addition & 1 deletion sdb/commands/linux/threads.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@ def pretty_print(self, objs: Iterable[drgn.Object]) -> None:
table.print_()

def no_input(self) -> Iterable[drgn.Object]:
yield from for_each_task(sdb.get_prog())
yield from for_each_task(prog=sdb.get_prog(), ns=sdb.get_prog())
2 changes: 1 addition & 1 deletion sdb/commands/tail.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ def _call(self, objs: Iterable[drgn.Object]) -> Iterable[drgn.Object]:
for obj in objs:
queue.append(obj)
for obj in queue:
yield obj
yield from obj
3 changes: 1 addition & 2 deletions sdb/commands/zfs/histograms.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,7 @@ def print_histogram(hist: drgn.Object,
min_bucket = bucket
if bucket > max_bucket and count > 0:
max_bucket = bucket
if count > max_count:
max_count = count
max_count = max(max_count, count)

HISTOGRAM_WIDTH_MAX = 40
max_count = max(max_count, HISTOGRAM_WIDTH_MAX)
Expand Down

0 comments on commit a2495a6

Please sign in to comment.