Skip to content

Commit

Permalink
Apply gevent monkey patching before we import requests, to avoid infi…
Browse files Browse the repository at this point in the history
…nite recursion error when doing SSL requests. Should fix #655.
  • Loading branch information
heyman committed Sep 16, 2017
1 parent 76828b7 commit 4e9ab7e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions locust/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,20 @@

import gevent
import six
from gevent import GreenletExit, monkey

from gevent import GreenletExit, monkey
from six.moves import xrange

# The monkey patching must run before requests is imported, or else
# we'll get an infinite recursion when doing SSL/HTTPS requests.
# See: https://github.com/requests/requests/issues/3752#issuecomment-294608002
monkey.patch_all(thread=False)

from . import events
from .clients import HttpSession
from .exception import (InterruptTaskSet, LocustError, RescheduleTask,
RescheduleTaskImmediately, StopLocust)

monkey.patch_all(thread=False)
logger = logging.getLogger(__name__)


Expand Down

0 comments on commit 4e9ab7e

Please sign in to comment.