diff options
author | Andy McCurdy <andy@andymccurdy.com> | 2014-05-28 14:22:34 -0700 |
---|---|---|
committer | Andy McCurdy <andy@andymccurdy.com> | 2014-05-28 14:22:34 -0700 |
commit | ce02a2eaf6e70af3b1789d73fa9c569c84d35449 (patch) | |
tree | 1ecbbbb09069e5f14a4b68e28d1fe515b8d00e05 | |
parent | eb56ddec86b7a0a79846ca2a606c36e1f29c6693 (diff) | |
download | redis-py-ce02a2eaf6e70af3b1789d73fa9c569c84d35449.tar.gz |
using repr() on a long value includes the trailing "L". use str() instead.
fixes #484
-rwxr-xr-x | redis/connection.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/redis/connection.py b/redis/connection.py index ff8a022..40966e3 100755 --- a/redis/connection.py +++ b/redis/connection.py @@ -554,9 +554,11 @@ class Connection(object): "Return a bytestring representation of the value" if isinstance(value, Token): return b(value.value) - if isinstance(value, bytes): + elif isinstance(value, bytes): return value - if isinstance(value, (int, long, float)): + elif isinstance(value, (int, long)): + value = b(str(value)) + elif isinstance(value, float): value = b(repr(value)) elif not isinstance(value, basestring): value = str(value) |