Closed bluetech closed 3 months ago
I'm curious as to why the use of dunder exception broke I recall it worked before
The breakage is entirely due to my misunderstanding of how exceptions work. In pluggy it is less impactful than the similar breakage in pytest because there's no potential of thousands of re-raises of the same exception, but wanted to fix it anyway.
The
Result
API allows the same exception to be raised multiple times. In Python,Exception.__traceback__
becomes longer every time an exception is raised. This means that on every raise, the exception's traceback gets longer and longer.To prevent this, save the original traceback and always raise using it.
Regressed in pluggy 1.1.0 (fbc4442).