diff --git a/httprunner/__init__.py b/httprunner/__init__.py index 6942cf6c..062b9ef9 100644 --- a/httprunner/__init__.py +++ b/httprunner/__init__.py @@ -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