Skip to content

Tell the exception line: Python.Runtime.PythonException:“division by zero” #2076

@bnuzhouwei

Description

@bnuzhouwei
using (Py.GIL())
{
    using (var scope = Py.CreateScope())
    {        
        dynamic module = scope.Exec("def add(x,y):return 1/0+x+y");
        var x = module.add(1, 2);
        Console.WriteLine(x);
    }
}

Only can get the exception as :

Python.Runtime.PythonException:“division by zero

Could the PythonException class contains the error line?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions