Skip to content

Commit

Permalink
Move gevent monkey.patch_all() to the top of __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Tei Im committed Aug 11, 2020
1 parent ea96475 commit 55151b2
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions celery/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

from __future__ import absolute_import, print_function, unicode_literals

import gevent
from gevent import monkey, signal as gevent_signal
monkey.patch_all()

import os
import re
import sys
Expand Down Expand Up @@ -113,10 +117,13 @@ def _patch_eventlet():


def _patch_gevent():
import gevent
from gevent import monkey, signal as gevent_signal

monkey.patch_all()
# Moved to the top of this file
# by Tei
#
# import gevent
# from gevent import monkey, signal as gevent_signal
#
# monkey.patch_all()
if gevent.version_info[0] == 0: # pragma: no cover
# Signals aren't working in gevent versions <1.0,
# and aren't monkey patched by patch_all()
Expand Down

0 comments on commit 55151b2

Please sign in to comment.