Skip to content

Commit 4fffc06

Browse files
Copilothpk42
andcommitted
Add clarifying comments for code review feedback
Co-authored-by: hpk42 <73579+hpk42@users.noreply.github.com>
1 parent f545883 commit 4fffc06

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

cmping.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,8 @@ def perform_ping(args):
591591
"""
592592
base_accounts_dir = xdg_cache_home().joinpath("cmping")
593593

594-
# Determine unique relays being tested
594+
# Determine unique relays being tested. Using a set to deduplicate when
595+
# relay1 == relay2 (same relay testing), so we only create one RPC context.
595596
relays = {args.relay1, args.relay2}
596597

597598
# Handle --reset option: remove account directories for tested relays
@@ -602,7 +603,8 @@ def perform_ping(args):
602603
print(f"# Removing account directory for {relay}: {relay_dir}")
603604
shutil.rmtree(relay_dir)
604605

605-
# Create per-relay account directories and RPC instances
606+
# Create per-relay account directories and RPC instances.
607+
# We manually manage __enter__/__exit__ to handle multiple context managers in a loop.
606608
relay_contexts = {} # {relay: RelayContext}
607609

608610
for relay in relays:

0 commit comments

Comments
 (0)