Skip to content

Commit 727c582

Browse files
committed
Print scanned relays to stderr when writing to file
1 parent c2bb3c3 commit 727c582

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/tor_relay_scanner/scanner.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ async def main_async(args):
200200
for relay in test_relays:
201201
if relay:
202202
print(str_list_with_prefix(BRIDGE_PREFIX, relay.reachables()), file=outstream)
203+
if sys.stdout != outstream:
204+
print(str_list_with_prefix(BRIDGE_PREFIX, relay.reachables()), file=sys.stderr)
203205
working_relays.append(relay)
204206
if not any(test_relays):
205207
print("No relays are reachable this try.", file=sys.stderr)

0 commit comments

Comments
 (0)