internal static unsafe void ErrorOccurredCheck(IntPtr pointer) { if ((pointer == IntPtr.Zero) || Exceptions.ErrorOccurred()) { throw new PythonException(); } }