Permalink
Browse files

Merge pull request #21 from jedp/master

fix for issue 19: teardown() not called if any vow fails
  • Loading branch information...
2 parents 42bc1b9 + 325da97 commit ff7cd7061b9e48d13f6aae0d2be33330714fe8b2 @heynemann committed Feb 15, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 pyvows/runner.py
View
@@ -238,10 +238,12 @@ def wrap(self, method):
@wraps(method)
def wrapper(*args, **kw):
- ret = method(*args, **kw)
- self.waiting -= 1
- self()
- return ret
+ try:
+ ret = method(*args, **kw)
+ return ret
+ finally:
+ self.waiting -= 1
+ self()
wrapper._original = method
return wrapper

0 comments on commit ff7cd70

Please sign in to comment.