Fixed stack-overflow that has been happening due to gevent unpatched imports
This commit is contained in:
parent
057a579d62
commit
5b7329b3d1
|
@ -1,14 +1,12 @@
|
|||
from gevent import monkey as gevent_monkey
|
||||
|
||||
import monkey_island.cc.environment.environment_singleton as env_singleton # noqa: E402
|
||||
from monkey_island.cc.arg_parser import parse_cli_args
|
||||
from monkey_island.setup.config_setup import setup_config_by_cmd_arg, setup_default_config
|
||||
|
||||
gevent_monkey.patch_all()
|
||||
# This import patches other imports and needs to be first
|
||||
import monkey_island.setup.gevent_setup # noqa: E402 F401 isort:skip
|
||||
|
||||
import json # noqa: E402
|
||||
|
||||
import monkey_island.cc.environment.environment_singleton as env_singleton # noqa: E402
|
||||
from monkey_island.cc.arg_parser import parse_cli_args
|
||||
from monkey_island.cc.server_utils.island_logger import setup_logging # noqa: E402
|
||||
from monkey_island.setup.config_setup import setup_config_by_cmd_arg, setup_default_config
|
||||
|
||||
if "__main__" == __name__:
|
||||
island_args = parse_cli_args()
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
from gevent import monkey as gevent_monkey
|
||||
|
||||
# We need to monkeypatch before any other imports to
|
||||
# make standard libraries compatible with gevent.
|
||||
# http://www.gevent.org/api/gevent.monkey.html
|
||||
gevent_monkey.patch_all()
|
Loading…
Reference in New Issue