8000 clrmethod working for python 2 by rickardraysearch · Pull Request #494 · pythonnet/pythonnet · GitHub
[go: up one dir, main page]

Skip to content

clrmethod working for python 2 #494

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 16, 2017
Prev Previous commit
Next Next commit
Use IntPtr.Zero instead of null for comparisons with IntPtrs
  • Loading branch information
Rickard Holmberg committed Jun 15, 2017
commit a21f5cff0d154c861430b976cc7ef1a0b86f2d89
4 changes: 2 additions & 2 deletions src/runtime/runtime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ internal static bool PyObject_IsIterable(IntPtr pointer)
return false;
#endif
IntPtr tp_iter = Marshal.ReadIntPtr(ob_type, TypeOffset.tp_iter);
return tp_iter != null;
return tp_iter != IntPtr.Zero;
}

[DllImport(PythonDll, CallingConvention = CallingConvention.Cdecl)]
Expand Down Expand Up @@ -1449,7 +1449,7 @@ internal static bool PyIter_Check(IntPtr pointer)
return false;
#endif
IntPtr tp_iternext = Marshal.ReadIntPtr(ob_type, TypeOffset.tp_iternext);
return tp_iternext != null && tp_iternext != _PyObject_NextNotImplemented;
return tp_iternext != IntPtr.Zero && tp_iternext != _PyObject_NextNotImplemented;
}

[DllImport(PythonDll, CallingConvention = CallingConvention.Cdecl)]
Expand Down
0