Skip to content

Commit ebdde7b

Browse files
committed
style: enforce multiline import style for consistency
1 parent 811c217 commit ebdde7b

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

libp2p/kad_dht/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Common Objects for Kademlia DHT implementation.
2+
Shared constants and protocol parameters for the Kademlia DHT.
33
"""
44

55
from libp2p.custom_types import (

libp2p/kad_dht/kad_dht.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
implementation based on the Kademlia algorithm and protocol.
66
"""
77

8-
from enum import Enum
8+
from enum import (
9+
Enum,
10+
)
911
import logging
1012
import time
1113

libp2p/kad_dht/routing_table.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22
Kademlia DHT routing table implementation.
33
"""
44

5-
from collections import OrderedDict
5+
from collections import (
6+
OrderedDict,
7+
)
68
import logging
79
import time
810

911
import trio
1012

11-
from libp2p.abc import IHost
13+
from libp2p.abc import (
14+
IHost,
15+
)
1216
from libp2p.kad_dht.utils import (
1317
xor_distance,
1418
)
@@ -238,12 +242,9 @@ async def _ping_peer(self, peer_id: ID) -> bool:
238242
if not peer_info:
239243
raise ValueError(f"Peer {peer_id} not in bucket")
240244

241-
# Default protocol ID for Kademlia DHT
242-
protocol_id = PROTOCOL_ID
243-
244245
try:
245246
# Open a stream to the peer with the DHT protocol
246-
stream = await self.host.new_stream(peer_id, [protocol_id])
247+
stream = await self.host.new_stream(peer_id, [PROTOCOL_ID])
247248

248249
try:
249250
# Create ping protobuf message

0 commit comments

Comments
 (0)