diff options
author | Konstantin Merenkov <kmerenkov@gmail.com> | 2010-05-22 02:58:15 +0800 |
---|---|---|
committer | Andy McCurdy <andy@andymccurdy.com> | 2010-06-02 01:42:49 +0800 |
commit | 7e8ec2e28d636fb878617f1d0788973aaffd309c (patch) | |
tree | 0e1dbbc0383f8d14d2c55eab84bb2b932d81aa96 /redis/client.py | |
parent | 9f360d566960de71eb8608fa9ce83777482a9dc9 (diff) | |
download | redis-py-7e8ec2e28d636fb878617f1d0788973aaffd309c.tar.gz |
blpop / brpop can accept string as key
Diffstat (limited to 'redis/client.py')
-rw-r--r-- | redis/client.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/redis/client.py b/redis/client.py index 9f17ae7..85be36c 100644 --- a/redis/client.py +++ b/redis/client.py @@ -670,7 +670,10 @@ class Redis(threading.local): If timeout is 0, then block indefinitely. """ - keys = list(keys) + if isinstance(keys, basestring): + keys = [keys] + else: + keys = list(keys) keys.append(timeout) return self.execute_command('BLPOP', *keys) @@ -685,7 +688,10 @@ class Redis(threading.local): If timeout is 0, then block indefinitely. """ - keys = list(keys) + if isinstance(keys, basestring): + keys = [keys] + else: + keys = list(keys) keys.append(timeout) return self.execute_command('BRPOP', *keys) |