(self, string, key, default)
Take from a more recent redis.py, parse_info
Take from a more recent redis.py, parse_info
Take from a more recent redis . py parse_info
def _parse_dict_string(self, string, key, default):
        """Take from a more recent redis.py, parse_info"""
        try:
            for item in string.split(','):
                k, v = item.rsplit('=', 1)
                if k == key:
                    try:
                        return int(v)
                    except ValueError:
                        return v
            return default
        except Exception:
            self.log.exception("Cannot parse dictionary string: %s", string)
            return default
def _parse_dict_string ( self , string , key , default ) : try : for item in string . split ( ',' ) : k , v = item . rsplit ( '=' , 1 ) if k == key : try : return int ( v ) except ValueError : return v return default except Exception : self . log . exception ( "Cannot parse dictionary string: %s" , string ) return default