File tree Expand file tree Collapse file tree 2 files changed +2
-1
lines changed
Expand file tree Collapse file tree 2 files changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -473,6 +473,7 @@ public static void SetError(Exception e) {
473473 IntPtr etype = Runtime . PyObject_GetAttrString ( op , "__class__" ) ;
474474 Runtime . PyErr_SetObject ( etype , op ) ;
475475 Runtime . Decref ( etype ) ;
476+ Runtime . Decref ( op ) ;
476477 }
477478
478479 /// <summary>
Original file line number Diff line number Diff line change @@ -27,11 +27,11 @@ public class PythonException : System.Exception {
2727
2828 public PythonException ( ) : base ( )
2929 {
30+ IntPtr gs = PythonEngine . AcquireLock ( ) ;
3031 Runtime . PyErr_Fetch ( ref _pyType , ref _pyValue , ref _pyTB ) ;
3132 Runtime . Incref ( _pyType ) ;
3233 Runtime . Incref ( _pyValue ) ;
3334 Runtime . Incref ( _pyTB ) ;
34- IntPtr gs = PythonEngine . AcquireLock ( ) ;
3535 if ( ( _pyType != IntPtr . Zero ) && ( _pyValue != IntPtr . Zero ) )
3636 {
3737 string type = new PyObject ( _pyType ) . GetAttr ( "__name__" ) . ToString ( ) ;
You can’t perform that action at this time.
0 commit comments