diff --git a/mockredis/client.py b/mockredis/client.py index 926e048..aecd4a9 100644 --- a/mockredis/client.py +++ b/mockredis/client.py @@ -155,6 +155,7 @@ def keys(self, pattern='*'): """Emulate keys.""" # making sure the pattern is unicode/str. try: + pattern = self._encode(pattern) pattern = pattern.decode('utf-8') # This throws an AttributeError in python 3, or an # UnicodeEncodeError in python 2