Skip to content

Commit

Permalink
Pass through args/kwargs in Python context mgr
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Krieger committed Dec 23, 2011
1 parent 9cb1ede commit a50c810
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/python/chashring.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ def free(self):
hash_ring.hash_ring_free(self._hash_ring_ptr)

@contextmanager
def create_hash_ring(nodes):
def create_hash_ring(*args, **kwargs):
""" Use this to safely use a HashRing object without worrying about having to
call 'free' afterwards.
"""
h = HashRing(nodes)
h = HashRing(*args, **kwargs)
yield h
h.free()

0 comments on commit a50c810

Please sign in to comment.