Merge branch 'sleekslush-master'

This commit is contained in:
Vincent Driessen 2012-07-18 14:24:50 +02:00
commit 0b66bbaab1
1 changed files with 3 additions and 3 deletions

View File

@ -11,11 +11,11 @@ class NoRedisConnectionException(Exception):
def Connection(connection=None):
if connection is None:
connection = Redis()
_connection_stack.push(connection)
push_connection(connection)
try:
yield
finally:
popped = _connection_stack.pop()
popped = pop_connection()
assert popped == connection, \
'Unexpected Redis connection was popped off the stack. ' \
'Check your Redis connection setup.'
@ -41,7 +41,7 @@ def use_connection(redis=None):
if redis is None:
redis = Redis()
_connection_stack.push(redis)
push_connection(redis)
def get_current_connection():