| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ea61b03 commit c1e5622
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -145,7 +145,9 @@ public static IntPtr tp_new(IntPtr tp, IntPtr args, IntPtr kw) | |||
| 145 | 145 | return IntPtr.Zero; | |
| 146 | 146 | } | |
| 147 | 147 | ||
| 148 | - var flags = TypeFlags.Default; | ||
| 148 | + var flags = (TypeFlags)Util.ReadCLong(type, TypeOffset.tp_flags); | ||
| 149 | + if (!flags.HasFlag(TypeFlags.Ready)) | ||
| 150 | + throw new NotSupportedException("PyType.tp_new returned an incomplete type"); | ||
| 149 | 151 | flags |= TypeFlags.HasClrInstance; | |
| 150 | 152 | flags |= TypeFlags.HeapType; | |
| 151 | 153 | flags |= TypeFlags.BaseType; | |
@@ -170,8 +172,7 @@ public static IntPtr tp_new(IntPtr tp, IntPtr args, IntPtr kw) | |||
| 170 | 172 | IntPtr gc = Marshal.ReadIntPtr(base_type, Offsets.tp_clr_inst); | |
| 171 | 173 | Marshal.WriteIntPtr(type, Offsets.tp_clr_inst, gc); | |
| 172 | 174 | ||
| 173 | - if (Runtime.PyType_Ready(type) != 0) | ||
| 174 | - throw PythonException.ThrowLastAsClrException(); | ||
| 175 | + Runtime.PyType_Modified(new BorrowedReference(type)); | ||
| 175 | 176 | ||
| 176 | 177 | return type; | |
| 177 | 178 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments