Skip to content

Commit

Permalink
Improve syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Charriere committed Oct 3, 2016
1 parent a1bf081 commit 93ffb33
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pymemcache/client/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ def _parse_hex(value):

def _check_key(key, key_prefix=b''):
"""Checks key and add key_prefix."""
if isinstance(key, six.text_type) or isinstance(key, six.string_types):
allowed_str_types = (six.text_type, six.string_types)
if isinstance(key, allowed_str_types):
try:
key = key.encode('ascii')
except (UnicodeEncodeError, UnicodeDecodeError):
Expand Down

0 comments on commit 93ffb33

Please sign in to comment.