diff options
author | Brendan Walker <brendan.walker@pelotoncycle.com> | 2017-02-15 11:05:11 -0500 |
---|---|---|
committer | Brendan Walker <brendan.walker@pelotoncycle.com> | 2017-02-15 11:05:11 -0500 |
commit | 6ef4948e53938c14f5af7cf59f60e193549f2fd0 (patch) | |
tree | 9aaad1af118ef94a165129ada2895de9d08ce09b /pymemcache | |
parent | 8d37d612f34af48fa2be6165b6143860afaabf93 (diff) | |
download | pymemcache-6ef4948e53938c14f5af7cf59f60e193549f2fd0.tar.gz |
Using bytearray
Diffstat (limited to 'pymemcache')
-rw-r--r-- | pymemcache/client/base.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/pymemcache/client/base.py b/pymemcache/client/base.py index 64c4580..3578058 100644 --- a/pymemcache/client/base.py +++ b/pymemcache/client/base.py @@ -96,9 +96,7 @@ def _check_key(key, allow_unicode_keys, key_prefix=b''): if len(key) > 250: raise MemcacheIllegalInputError("Key is too long: '%r'" % (key,)) - for c in key: - if isinstance(c, VALID_STRING_TYPES): - c = ord(c) + for c in bytearray(key): if c == ord(b' '): raise MemcacheIllegalInputError( "Key contains space: '%r'" % (key,) |