diff --git a/folly/experimental/coro/scripts/co_bt.py b/folly/experimental/coro/scripts/co_bt.py index ba0d99c5440..77181ca9630 100755 --- a/folly/experimental/coro/scripts/co_bt.py +++ b/folly/experimental/coro/scripts/co_bt.py @@ -264,7 +264,7 @@ def print_async_stack_addrs(addrs: List[DebuggerValue]) -> None: print("No async operation detected") return num_digits = len(str(len(addrs))) - for (i, addr) in enumerate(addrs): + for i, addr in enumerate(addrs): func_name = addr.get_func_name() if func_name is None: func_name = "???" @@ -442,7 +442,7 @@ def print_async_stack_root_addrs(addrs: List[DebuggerValue]) -> None: print("No async stack roots detected") return num_digits = len(str(len(addrs))) - for (i, addr) in enumerate(addrs): + for i, addr in enumerate(addrs): async_stack_root = AsyncStackRoot.from_addr(addr) if not async_stack_root.stack_frame_ptr.is_nullptr(): stack_frame = StackFrame.from_addr(async_stack_root.stack_frame_ptr) @@ -594,7 +594,9 @@ def to_hex(self) -> str: def get_file_name_and_line(self) -> Optional[Tuple[str, int]]: regex = re.compile(r"Line (\d+) of (.*) starts at.*") - output = GdbValue.execute(f"info line *{self.to_hex()}",).split( + output = GdbValue.execute( + f"info line *{self.to_hex()}", + ).split( "\n" )[0] groups = regex.match(output) @@ -606,7 +608,9 @@ def get_file_name_and_line(self) -> Optional[Tuple[str, int]]: def get_func_name(self) -> Optional[str]: regex = re.compile(r"(.*) \+ \d+ in section.* of .*") - output = GdbValue.execute(f"info symbol {self.to_hex()}",).split( + output = GdbValue.execute( + f"info symbol {self.to_hex()}", + ).split( "\n" )[0] groups = regex.match(output) diff --git a/folly/experimental/coro/scripts/test/co_bt.py b/folly/experimental/coro/scripts/test/co_bt.py index d8a8a1f7e98..e65fd3ce0e2 100644 --- a/folly/experimental/coro/scripts/test/co_bt.py +++ b/folly/experimental/coro/scripts/test/co_bt.py @@ -16,6 +16,7 @@ import sys import unittest + # mock lldb module class Lldb: class Command: diff --git a/folly/experimental/gdb/deadlock.py b/folly/experimental/gdb/deadlock.py index 02718bb835b..feeae0713fe 100644 --- a/folly/experimental/gdb/deadlock.py +++ b/folly/experimental/gdb/deadlock.py @@ -319,7 +319,7 @@ def get_mutex_owner_and_address_func_for_type(mutex_type): def print_cycle(graph, lwp_to_thread_id, cycle): """Prints the threads and mutexes involved in the deadlock.""" - for (m, n) in cycle: + for m, n in cycle: print( "Thread %d (LWP %d) is waiting on %s (0x%016x) held by " "Thread %d (LWP %d)" diff --git a/folly/fibers/scripts/gdb.py b/folly/fibers/scripts/gdb.py index d7d41c4ff3a..ebbf4180b0a 100644 --- a/folly/fibers/scripts/gdb.py +++ b/folly/fibers/scripts/gdb.py @@ -736,7 +736,7 @@ def get_fiber_info(only=None, managers=False): # first check if pre-cached if mid in get_fiber_info.cache: - for (fid, info) in get_fiber_info.cache[mid].items(): + for fid, info in get_fiber_info.cache[mid].items(): fiber_id = "{}.{}".format(mid, fid) if not only or str(mid) in only or fiber_id in only: yield ((mid, fid), info) @@ -773,7 +773,7 @@ def get_fiber_managers(only=None): """ # first check if pre-cached if get_fiber_managers.cache: - for (mid, manager) in get_fiber_managers.cache.items(): + for mid, manager in get_fiber_managers.cache.items(): # output only if matching filter if not only or str(mid) in only: yield (mid, manager)