fix duplicate monkey patch

This commit is contained in:
debugtalk
2018-12-04 14:46:30 +08:00
parent 9e6ffd8a39
commit 970591e29f

View File

@@ -2,7 +2,12 @@
try:
# monkey patch at beginning to avoid RecursionError when running locust.
from gevent import monkey; monkey.patch_all()
from gevent import monkey
if not monkey.is_module_patched('socket'):
print("========== monkey patch all ==========")
monkey.patch_all()
else:
print("========== monkey patched ==========")
except ImportError:
pass