File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -261,11 +261,10 @@ internal static void ThrowIfIsNull(BorrowedReference reference)
261
261
}
262
262
}
263
263
264
- public static void ThrowIfIsNotZero ( int value , Action onBeforeThrow = null )
264
+ public static void ThrowIfIsNotZero ( int value )
265
265
{
266
266
if ( value != 0 )
267
267
{
268
- onBeforeThrow ? . Invoke ( ) ;
269
268
throw new PythonException ( ) ;
270
269
}
271
270
}
Original file line number Diff line number Diff line change @@ -74,7 +74,11 @@ private static IntPtr FromArray(PyObject[] items)
74
74
IntPtr ptr = items [ i ] . obj ;
75
75
Runtime . XIncref ( ptr ) ;
76
76
int res = Runtime . PyTuple_SetItem ( val , i , ptr ) ;
77
- PythonException . ThrowIfIsNotZero ( res , ( ) => Runtime . Py_DecRef ( val ) ) ;
77
+ if ( res == 0 )
78
+ {
79
+ Runtime . Py_DecRef ( val ) ;
80
+ PythonException . ThrowIfIsNotZero ( res ) ;
81
+ }
78
82
}
79
83
return val ;
80
84
}
You can’t perform that action at this time.
0 commit comments