diff --git a/hy/util.py b/hy/util.py index b855038..6b26543 100644 --- a/hy/util.py +++ b/hy/util.py @@ -34,12 +34,7 @@ def temporary_attribute_value(obj, attribute, value): """Temporarily switch an object attribute value to another value.""" original_value = getattr(obj, attribute) setattr(obj, attribute, value) - - try: - yield - except Exception: - pass - + yield setattr(obj, attribute, original_value)