Skip to content

Bug: raise without an active exception re-raises the previous exception #807

@dmamelin

Description

@dmamelin

Reproducer:

try:
    raise ValueError("Random error")
except ValueError as e:
    log.info(f"{type(e)}: {e}")

try:
    raise
except Exception as e:
    log.info(f"reraise {type(e)}: {e}")

Actual output:

<class 'ValueError'>: Random error
reraise <class 'ValueError'>: Random error

Expected output:

<class 'ValueError'>: Random error
reraise <class 'RuntimeError'>: No active exception to reraise

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions