Clarify messages when optional modules are not found.
This commit is contained in:
parent
477947ba96
commit
b7f255ce0b
|
|
@ -50,15 +50,15 @@ except:
|
||||||
return struct.unpack(fmt, slice)
|
return struct.unpack(fmt, slice)
|
||||||
|
|
||||||
# Degraded functionality if these imports are missing
|
# Degraded functionality if these imports are missing
|
||||||
for mod, sup in [('numpy', 'HyBi protocol'), ('ssl', 'TLS/SSL/wss'),
|
for mod, msg in [('numpy', 'HyBi protocol will be slower'),
|
||||||
('multiprocessing', 'Multi-Processing'),
|
('ssl', 'TLS/SSL/wss is disabled'),
|
||||||
('resource', 'daemonizing')]:
|
('multiprocessing', 'Multi-Processing is disabled'),
|
||||||
|
('resource', 'daemonizing is disabled')]:
|
||||||
try:
|
try:
|
||||||
globals()[mod] = __import__(mod)
|
globals()[mod] = __import__(mod)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
globals()[mod] = None
|
globals()[mod] = None
|
||||||
print("WARNING: no '%s' module, %s is slower or disabled" % (
|
print("WARNING: no '%s' module, %s" % (mod, msg))
|
||||||
mod, sup))
|
|
||||||
if multiprocessing and sys.platform == 'win32':
|
if multiprocessing and sys.platform == 'win32':
|
||||||
# make sockets pickle-able/inheritable
|
# make sockets pickle-able/inheritable
|
||||||
import multiprocessing.reduction
|
import multiprocessing.reduction
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue