8000 Fix exception causes · Issue #998 · nedbat/coveragepy · GitHub
[go: up one dir, main page]

Skip to content
Fix exception causes #998
@cool-RR

Description

@cool-RR

I was going over a few open-source Python packages and fixing the way exception causes are set, while a failing CI run turned my attention to the fact that coverage has the same bug.

See line 10 of the traceback linked above. The line says "During handling of the above exception, another exception occurred" while it should say "The above exception was the direct cause of the following exception".

A fix would be trickier in the case of coverage, since it maintains Python 2.7 support. This can be done using a raise-like compatibility function that manually sets new_exception.__cause__ = old_exception. That's easy to write, and should probably be added in the backward module, the question is: Do you want this change in coverage?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0