8000 apply amos interop changes from soft shutdown by koubaa · Pull Request #1219 · pythonnet/pythonnet · GitHub
[go: up one dir, main page]

Skip to content

apply amos interop changes from soft shutdown #1219

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

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use HasFlag
  • Loading branch information
koubaa committed Sep 17, 2020
commit 7f576cfc8dc505cce30c0adb4d3d4d62d76207df
4 changes: 2 additions & 2 deletions src/runtime/clrobject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ internal CLRObject(object ob, IntPtr tp)
{
IntPtr py = Runtime.PyType_GenericAlloc(tp, 0);

long flags = Util.ReadCLong(tp, TypeOffset.tp_flags);
if ((flags & (int)TypeFlags.Subclass) != 0)
var flags = (TypeFlags)Util.ReadCLong(tp, TypeOffset.tp_flags);
if (flags.HasFlag(TypeFlags.Subclass))
{
IntPtr dict = Marshal.ReadIntPtr(py, ObjectOffset.TypeDictOffset(tp));
if (dict == IntPtr.Zero)
Expand Down
7 changes: 2 additions & 5 deletions src/runtime/managedtype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,8 @@ internal static bool IsManagedType(IntPtr ob)
tp = ob;
}

var flags = Util.ReadCLong(tp, TypeOffset.tp_flags);
if ((flags & (int)TypeFlags.Managed) != 0)
{
return true;
}
var flags = (TypeFlags)Util.ReadCLong(tp, TypeOffset.tp_flags);
return flags.HasFlag(TypeFlags.Managed);
}
return false;
}
Expand Down
0