Wrap import of BMConnectionPool and AnnounceThread into try: .. except:

for partial testing on python3.
This commit is contained in:
Lee Miller 2022-06-12 02:14:19 +03:00
parent 8fc42b758d
commit 55b92dffbb
Signed by untrusted user: lee.miller
GPG Key ID: 4F97A5EA88F4AB63

View File

@ -2,17 +2,21 @@
Network subsystem package
"""
from .connectionpool import BMConnectionPool
try:
from .announcethread import AnnounceThread
from .connectionpool import BMConnectionPool
except ImportError:
AnnounceThread = None
BMConnectionPool = None
from .threads import StoppableThread
__all__ = ["BMConnectionPool", "StoppableThread"]
__all__ = ["AnnounceThread", "BMConnectionPool", "StoppableThread"]
def start(config, state):
"""Start network threads"""
from .addrthread import AddrThread
from .announcethread import AnnounceThread
from .dandelion import Dandelion
from .downloadthread import DownloadThread
from .invthread import InvThread