Permalink
Browse files

switch empties logic so that empties gets cleaned as it goes

  • Loading branch information...
atl committed May 27, 2010
1 parent 25cb43b commit 858eb65bd6643c40abef70bf63364c1661ef64cd
Showing with 5 additions and 2 deletions.
  1. +5 −2 redish/proxy.py
View
@@ -64,9 +64,12 @@ def __getitem__(self, key):
"""Return a proxy type according to the native redis type
associated with the key."""
typ = self.type(key)
- if typ == 'none':
- if key in self.empties:
+ if key in self.empties:
+ if typ == 'none':
return self.empties[key]
+ else:
+ self.empties.pop(key)
+ if typ == 'none':
result = self.miss(key)
if isinstance(result, Exception):
raise result

0 comments on commit 858eb65

Please sign in to comment.