示例#1
0
        /// <summary>
        /// When called after SetError, sets the cause of the error.
        /// </summary>
        /// <param name="cause">The cause of the current error</param>
        public static void SetCause(PythonException cause)
        {
            var currentException = new PythonException();

            currentException.Normalize();
            cause.Normalize();
            Runtime.XIncref(cause.PyValue);
            Runtime.PyException_SetCause(currentException.PyValue, cause.PyValue);
            currentException.Restore();
        }