Skip to content

Commit

Permalink
reduce traceback nesting
Browse files Browse the repository at this point in the history
  • Loading branch information
asottile authored Aug 25, 2021
1 parent 5fab2ab commit 5eabc69
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cfgv.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def validate_context(msg):
yield
except ValidationError as e:
_, _, tb = sys.exc_info()
raise ValidationError(e, ctx=msg).with_traceback(tb)
raise ValidationError(e, ctx=msg).with_traceback(tb) from None


@contextlib.contextmanager
Expand All @@ -40,7 +40,7 @@ def reraise_as(tp):
yield
except ValidationError as e:
_, _, tb = sys.exc_info()
raise tp(e).with_traceback(tb)
raise tp(e).with_traceback(tb) from None


def _dct_noop(self, dct):
Expand Down

0 comments on commit 5eabc69

Please sign in to comment.