File tree 2 files changed +2
-1
lines changed
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) {
473
473
IntPtr etype = Runtime . PyObject_GetAttrString ( op , "__class__" ) ;
474
474
Runtime . PyErr_SetObject ( etype , op ) ;
475
475
Runtime . Decref ( etype ) ;
476
+ Runtime . Decref ( op ) ;
476
477
}
477
478
478
479
/// <summary>
Original file line number Diff line number Diff line change @@ -27,11 +27,11 @@ public class PythonException : System.Exception {
27
27
28
28
public PythonException ( ) : base ( )
29
29
{
30
+ IntPtr gs = PythonEngine . AcquireLock ( ) ;
30
31
Runtime . PyErr_Fetch ( ref _pyType , ref _pyValue , ref _pyTB ) ;
31
32
Runtime . Incref ( _pyType ) ;
32
33
Runtime . Incref ( _pyValue ) ;
33
34
Runtime . Incref ( _pyTB ) ;
34
- IntPtr gs = PythonEngine . AcquireLock ( ) ;
35
35
if ( ( _pyType != IntPtr . Zero ) && ( _pyValue != IntPtr . Zero ) )
36
36
{
37
37
string type = new PyObject ( _pyType ) . GetAttr ( "__name__" ) . ToString ( ) ;
You can’t perform that action at this time.
0 commit comments