We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
2 parentsd300111 +c1e5622 commit1391639Copy full SHA for 1391639
src/runtime/metatype.cs
@@ -145,7 +145,9 @@ public static IntPtr tp_new(IntPtr tp, IntPtr args, IntPtr kw)
145
returnIntPtr.Zero;
146
}
147
148
-varflags=TypeFlags.Default;
+varflags=(TypeFlags)Util.ReadCLong(type,TypeOffset.tp_flags);
149
+if(!flags.HasFlag(TypeFlags.Ready))
150
+thrownewNotSupportedException("PyType.tp_new returned an incomplete type");
151
flags|=TypeFlags.HasClrInstance;
152
flags|=TypeFlags.HeapType;
153
flags|=TypeFlags.BaseType;
@@ -170,8 +172,7 @@ public static IntPtr tp_new(IntPtr tp, IntPtr args, IntPtr kw)
170
172
IntPtrgc=Marshal.ReadIntPtr(base_type,Offsets.tp_clr_inst);
171
173
Marshal.WriteIntPtr(type,Offsets.tp_clr_inst,gc);
174
-if(Runtime.PyType_Ready(type)!=0)
-throwPythonException.ThrowLastAsClrException();
175
+Runtime.PyType_Modified(newBorrowedReference(type));
176
177
returntype;
178