Skip to content

Commit 5aaa4e4

Browse files
committed
ch22: examples
1 parent a751c86 commit 5aaa4e4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

22-asyncio/domains/probe.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88

99

1010
async def main(tld: str) -> None:
11-
names = (f'{w}.{tld}'.lower() for w in kwlist if len(w) <= 4)
12-
async for name, found in multi_probe(sorted(names)):
11+
tld = tld.strip('.')
12+
names = (w.lower() for w in kwlist if len(w) <= 4)
13+
domains = (f'{name}.{tld}' for name in names)
14+
async for name, found in multi_probe(domains):
1315
mark = '.' if found else '?\t\t'
1416
print(f'{mark} {name}')
1517

0 commit comments

Comments
 (0)