Skip to content

Commit

Permalink
Fixed runtime error in RandomProxy.get_handler
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantin Nikitin committed Oct 26, 2012
1 parent 820ee98 commit ed68198
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vaurien/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,11 @@ def initialize_choices(self):
choices['normal'] = normal, missing

for name, (handler, percent) in choices.items():
self.choices.extend([self.handlers[name] for i in range(percent)])
self.choices.extend(
[(self.handlers[name], name) for i in range(percent)])

def get_handler(self):
return random.choice(self.choices.items())
return random.choice(self.choices)


class OnTheFlyProxy(DefaultProxy):
Expand Down

0 comments on commit ed68198

Please sign in to comment.