File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -36,23 +36,24 @@ public PythonException() : base()
3636 {
3737 string type ;
3838 string message ;
39+ Runtime . Incref ( _pyType ) ;
3940 using ( PyObject pyType = new PyObject ( _pyType ) )
4041 using ( PyObject pyTypeName = pyType . GetAttr ( "__name__" ) )
4142 {
4243 type = pyTypeName . ToString ( ) ;
4344 }
44-
45+
46+ Runtime . Incref ( _pyValue ) ;
4547 using ( PyObject pyValue = new PyObject ( _pyValue ) )
4648 {
4749 message = pyValue . ToString ( ) ;
4850 }
49- ;
50-
5151 _message = type + " : " + message ;
5252 }
5353 if ( _pyTB != IntPtr . Zero )
5454 {
5555 PyObject tb_module = PythonEngine . ImportModule ( "traceback" ) ;
56+ Runtime . Incref ( _pyTB ) ;
5657 using ( PyObject pyTB = new PyObject ( _pyTB ) ) {
5758 _tb = tb_module . InvokeMethod ( "format_tb" , pyTB ) . ToString ( ) ;
5859 }
You can’t perform that action at this time.
0 commit comments