Permalink
Browse files

Fix horribly long line with sane alternative.

  • Loading branch information...
bbangert committed Aug 13, 2012
1 parent 1863902 commit 45dd3a24e12b1ddfa553ceac7a59b6a4f1e3fe45
Showing with 3 additions and 1 deletion.
  1. +3 −1 beaker/ext/memcached.py
View
@@ -107,7 +107,9 @@ def get_creation_lock(self, key):
(self.namespace, key), lock_dir=self.lock_dir)
def _format_key(self, key):
- formated_key = (self.namespace + '_' + (key if isinstance(key, str) else key.decode('ascii'))).replace(' ', '\302\267')
+ if not isinstance(key, str):
+ key = key.decode('ascii')
+ formated_key = (self.namespace + '_' + key).replace(' ', '\302\267')
if len(formated_key) > MAX_KEY_LENGTH:
formated_key = sha1(formated_key).hexdigest()
return formated_key

0 comments on commit 45dd3a2

Please sign in to comment.