summaryrefslogtreecommitdiff
path: root/redis/client.py
diff options
context:
space:
mode:
authorAli Onur Uyar <aouyar@gmail.com>2012-11-27 12:27:08 +0200
committerAli Onur Uyar <aouyar@gmail.com>2012-11-27 12:27:08 +0200
commit8205c3d5e3ccac16743b3e5b40cd5645d5d65ffb (patch)
tree251ffa9709434b85c7dd5733d07178e8c9db25d7 /redis/client.py
parentd0b312c4b5fd117fcc0b9ebddbe2802e717df664 (diff)
downloadredis-py-8205c3d5e3ccac16743b3e5b40cd5645d5d65ffb.tar.gz
Leave handling of older versions for INFO cmd to the user.
Diffstat (limited to 'redis/client.py')
-rw-r--r--redis/client.py20
1 files changed, 8 insertions, 12 deletions
diff --git a/redis/client.py b/redis/client.py
index f970e81..ebc2c5c 100644
--- a/redis/client.py
+++ b/redis/client.py
@@ -432,24 +432,20 @@ class StrictRedis(object):
"Delete all keys in the current database"
return self.execute_command('FLUSHDB')
- def info(self, name=None):
+ def info(self, section=None):
"""
Returns a dictionary containing information about the Redis server
- The name argument is not supported by older versions of Redis Server,
- and will return an empty dictionary.
+ The ``section`` option can be used to select a specific section
+ of information
+
+ The section option is not supported by older versions of Redis Server,
+ and will generate ResponseError
"""
- if name is None:
+ if section is None:
return self.execute_command('INFO')
else:
- try:
- return self.execute_command('INFO', name)
- except ResponseError:
- e = sys.exc_info()[1]
- if len(e.args) > 0 and e.args[0] == 'syntax error':
- return {}
- else:
- raise
+ return self.execute_command('INFO', section)
def lastsave(self):
"""