Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
This function does not return any values.
"""
global original_classes
global StrictRedis_Patched
if StrictRedis_Patched:
logger.info('redis.StrictRedis class has already been patched')
return
if dbfile:
if dbfile == os.path.basename(dbfile):
dbfile = os.path.join(os.getcwd(), dbfile)
StrictRedis.dbdir = os.path.dirname(dbfile)
StrictRedis.dbfilename = os.path.basename(dbfile)
StrictRedis.settingregistryfile = os.path.join(
StrictRedis.dbdir, StrictRedis.dbfilename + '.settings'
)
original_classes['StrictRedis'] = redis.StrictRedis
redis.StrictRedis = StrictRedis
StrictRedis_Patched = True
Returns:
This function does not return any values.
"""
global original_classes
global StrictRedis_Patched
if StrictRedis_Patched:
logger.info('redis.StrictRedis class has already been patched')
return
if dbfile:
if dbfile == os.path.basename(dbfile):
dbfile = os.path.join(os.getcwd(), dbfile)
StrictRedis.dbdir = os.path.dirname(dbfile)
StrictRedis.dbfilename = os.path.basename(dbfile)
StrictRedis.settingregistryfile = os.path.join(
StrictRedis.dbdir, StrictRedis.dbfilename + '.settings'
)
original_classes['StrictRedis'] = redis.StrictRedis
redis.StrictRedis = StrictRedis
StrictRedis_Patched = True