Skip to content

Commit 55b92df

Browse files
author
Lee Miller
committed
Wrap import of BMConnectionPool and AnnounceThread into try: .. except:
for partial testing on python3.
1 parent 8fc42b7 commit 55b92df

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/network/__init__.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,21 @@
22
Network subsystem package
33
"""
44

5-
from .connectionpool import BMConnectionPool
5+
try:
6+
from .announcethread import AnnounceThread
7+
from .connectionpool import BMConnectionPool
8+
except ImportError:
9+
AnnounceThread = None
10+
BMConnectionPool = None
611
from .threads import StoppableThread
712

813

9-
__all__ = ["BMConnectionPool", "StoppableThread"]
14+
__all__ = ["AnnounceThread", "BMConnectionPool", "StoppableThread"]
1015

1116

1217
def start(config, state):
1318
"""Start network threads"""
1419
from .addrthread import AddrThread
15-
from .announcethread import AnnounceThread
1620
from .dandelion import Dandelion
1721
from .downloadthread import DownloadThread
1822
from .invthread import InvThread

0 commit comments

Comments
 (0)