@@ -2034,23 +2034,32 @@ internal static IntPtr PyMem_Realloc(IntPtr ptr, long size)
20342034 internal static extern int PyErr_GivenExceptionMatches( IntPtr ob, IntPtr val) ;
20352035
20362036 [ DllImport( _PythonDll, CallingConvention = CallingConvention. Cdecl) ]
2037- internal static extern void PyErr_NormalizeException( IntPtr ob, IntPtr val, IntPtr tb) ;
2037+ internal static extern void PyErr_NormalizeException( ref NewReference ob, ref NewReference val, ref NewReference tb) ;
20382038
20392039 [ DllImport( _PythonDll, CallingConvention = CallingConvention. Cdecl) ]
20402040 internal static extern IntPtr PyErr_Occurred( ) ;
20412041
20422042 [ DllImport( _PythonDll, CallingConvention = CallingConvention. Cdecl) ]
20432043 internal static extern void PyErr_Fetch( out IntPtr ob, out IntPtr val, out IntPtr tb) ;
2044+ [ DllImport( _PythonDll, CallingConvention = CallingConvention. Cdecl) ]
2045+ internal static extern void PyErr_Fetch( out NewReference ob, out NewReference val, out NewReference tb) ;
20442046
20452047 [ DllImport( _PythonDll, CallingConvention = CallingConvention. Cdecl) ]
20462048 internal static extern void PyErr_Restore( IntPtr ob, IntPtr val, IntPtr tb) ;
2049+ [ DllImport( _PythonDll, CallingConvention = CallingConvention. Cdecl) ]
2050+ internal static extern void PyErr_Restore( StolenReference ob, StolenReference val, StolenReference tb) ;
20472051
20482052 [ DllImport( _PythonDll, CallingConvention = CallingConvention. Cdecl) ]
20492053 internal static extern void PyErr_Clear( ) ;
20502054
20512055 [ DllImport( _PythonDll, CallingConvention = CallingConvention. Cdecl) ]
20522056 internal static extern void PyErr_Print( ) ;
20532057
2058+ [ DllImport( _PythonDll, CallingConvention = CallingConvention. Cdecl) ]
2059+ internal static extern void PyException_SetCause( BorrowedReference ex, StolenReference cause) ;
2060+ [ DllImport( _PythonDll, CallingConvention = CallingConvention. Cdecl) ]
2061+ internal static extern int PyException_SetTraceback( BorrowedReference ex, BorrowedReference cause) ;
2062+
20542063 //====================================================================
20552064 // Cell API
20562065 //====================================================================
0 commit comments