Skip to content

Commit d6c5cd6

Browse files
committed
Use explicit import and __all__ in bitcoin.net
Previously was exporting bitcoin.core.serialize namespace.
1 parent b2f803c commit d6c5cd6

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

bitcoin/net.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@
1515
import socket
1616
from binascii import hexlify
1717

18-
from .core import PROTO_VERSION, CADDR_TIME_VERSION
19-
from .core.serialize import *
18+
from bitcoin.core.serialize import (
19+
Serializable,
20+
VarStringSerializer,
21+
ser_read,
22+
uint256VectorSerializer,
23+
)
2024

2125
PROTO_VERSION = 60002
2226
CADDR_TIME_VERSION = 31402
@@ -170,3 +174,13 @@ def stream_serialize(self, f):
170174

171175
def __repr__(self):
172176
return "CAlert(vchMsg.sz %d, vchSig.sz %d)" % (len(self.vchMsg), len(self.vchSig))
177+
178+
__all__ = (
179+
'PROTO_VERSION',
180+
'CADDR_TIME_VERSION',
181+
'CAddress',
182+
'CInv',
183+
'CBlockLocator',
184+
'CUnsignedAlert',
185+
'CAlert',
186+
)

0 commit comments

Comments
 (0)