You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
521 B
17 lines
521 B
5 years ago
|
# Under Python 2, if the `future` module is installed, we get
|
||
|
# a `builtins` module, which mimics the `builtins` module from
|
||
|
# Python 3, but does not have the __import__ and some other functions.
|
||
|
# Make sure we can still run in that case.
|
||
|
import sys
|
||
|
try:
|
||
|
# fake out a "broken" builtins module
|
||
|
import builtins
|
||
|
except ImportError:
|
||
|
class builtins(object):
|
||
|
pass
|
||
|
sys.modules['builtins'] = builtins()
|
||
|
|
||
|
if not hasattr(builtins, '__import__'):
|
||
|
import gevent.monkey
|
||
|
gevent.monkey.patch_builtins()
|