We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c1a9d94 commit 7fc375dCopy full SHA for 7fc375d
1 file changed
src/runtime/pythonexception.cs
@@ -36,23 +36,24 @@ public PythonException() : base()
36
{
37
string type;
38
string message;
39
+ Runtime.Incref(_pyType);
40
using (PyObject pyType = new PyObject(_pyType))
41
using (PyObject pyTypeName = pyType.GetAttr("__name__"))
42
43
type = pyTypeName.ToString();
44
}
-
45
+
46
+ Runtime.Incref(_pyValue);
47
using (PyObject pyValue = new PyObject(_pyValue))
48
49
message = pyValue.ToString();
50
- ;
51
_message = type + " : " + message;
52
53
if (_pyTB != IntPtr.Zero)
54
55
PyObject tb_module = PythonEngine.ImportModule("traceback");
56
+ Runtime.Incref(_pyTB);
57
using (PyObject pyTB = new PyObject(_pyTB)) {
58
_tb = tb_module.InvokeMethod("format_tb", pyTB).ToString();
59
0 commit comments