Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix warning regarding undefined __module__ on GC Offset Base#1646

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
lostmsu merged 1 commit intopythonnet:masterfromfilmor:internal-module
Dec 23, 2021
Merged
Show file tree
Hide file tree
Changes fromall commits
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
6 changes: 3 additions & 3 deletionssrc/runtime/typemanager.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -456,7 +456,7 @@ internal static PyType CreateMetatypeWithGCHandleOffset()
int size = Util.ReadInt32(Runtime.PyTypeType, TypeOffset.tp_basicsize)
+ IntPtr.Size // tp_clr_inst_offset
;
var result = new PyType(new TypeSpec("GC Offset Base", basicSize: size,
var result = new PyType(new TypeSpec("clr._internal.GCOffsetBase", basicSize: size,
new TypeSpec.Slot[]
{

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

PyType gcOffsetBase = CreateMetatypeWithGCHandleOffset();

PyType type = AllocateTypeObject("CLR Metatype", metatype: gcOffsetBase);
PyType type = AllocateTypeObject("CLRMetatype", metatype: gcOffsetBase);

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

Expand DownExpand Up@@ -509,7 +509,7 @@ internal static PyType CreateMetaType(Type impl, out SlotsHolder slotsHolder)
}

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

// The type has been modified after PyType_Ready has been called
Expand Down
2 changes: 1 addition & 1 deletiontests/utils.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,7 +24,7 @@ def is_clr_root_module(ob):


def is_clr_class(ob):
return type(ob).__name__ == 'CLR Metatype' # for now
return type(ob).__name__ == 'CLRMetatype' and type(ob).__module__ == 'clr._internal' # for now


class ClassicClass:
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp