def _gevent_patch ( ) : try : assert gevent assert grequests except NameError : logger . warn ( 'gevent not exist, fallback to multiprocess...' ) return MULTITHREAD else : monkey . patch_all ( ) # Must patch before get_photos_info return GEVENT
python gevent is not defined
Patch the modules with gevent
def _gevent_patch():
    """Patch the modules with gevent

    :return: Default is GEVENT. If it not supports gevent then return MULTITHREAD
    :rtype: int
    """
    try:
        assert gevent
        assert grequests
    except NameError:
        logger.warn('gevent not exist, fallback to multiprocess...')
        return MULTITHREAD
    else:
        monkey.patch_all()  # Must patch before get_photos_info
        return GEVENT