Skip to content

Commit c9ad7cd

Browse files
committed
Fix warning regarding undefined __module__ on GC Offset Base
Also makes the type names a bit more Python-esque. The `clr._internal` module doesn't exist, but that is no difference to the previous setup.
1 parent 9fb7e65 commit c9ad7cd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/runtime/typemanager.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ internal static PyType CreateMetatypeWithGCHandleOffset()
456456
int size = Util.ReadInt32(Runtime.PyTypeType, TypeOffset.tp_basicsize)
457457
+ IntPtr.Size // tp_clr_inst_offset
458458
;
459-
var result = new PyType(new TypeSpec("GC Offset Base", basicSize: size,
459+
var result = new PyType(new TypeSpec("clr._internal.GCOffsetBase", basicSize: size,
460460
new TypeSpec.Slot[]
461461
{
462462

@@ -480,7 +480,7 @@ internal static PyType CreateMetaType(Type impl, out SlotsHolder slotsHolder)
480480

481481
PyType gcOffsetBase = CreateMetatypeWithGCHandleOffset();
482482

483-
PyType type = AllocateTypeObject("CLR Metatype", metatype: gcOffsetBase);
483+
PyType type = AllocateTypeObject("Metatype", metatype: gcOffsetBase);
484484

485485
Util.WriteRef(type, TypeOffset.tp_base, new NewReference(gcOffsetBase).Steal());
486486

@@ -509,7 +509,7 @@ internal static PyType CreateMetaType(Type impl, out SlotsHolder slotsHolder)
509509
}
510510

511511
BorrowedReference dict = Util.ReadRef(type, TypeOffset.tp_dict);
512-
using (var mod = Runtime.PyString_FromString("CLR"))
512+
using (var mod = Runtime.PyString_FromString("clr._internal"))
513513
Runtime.PyDict_SetItemString(dict, "__module__", mod.Borrow());
514514

515515
// The type has been modified after PyType_Ready has been called

0 commit comments

Comments
 (0)