Skip to content

Derived exceptions not caught by C# #1012

@slozier

Description

@slozier

For example:

class Test(SystemExit): pass

raise Test

does not terminate the process. The C# code expects a SystemExitException but the exception ends up being of type Exception.

Also, an IndexError (which becomes an IndexOutOfRangeException) would not be caught by LookupException handler in C# even though LookupError is a base of IndexError. For example:

try {
    PythonCalls.Call(context, somethingthatthrowsindexerror);
} catch (LookupException e) {
    // do stuff
}

would not catch the exception.

This came up in #1011.

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreIssues relating to core functionality (e.g. syntax)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions