-
Notifications
You must be signed in to change notification settings - Fork 773
Modernize import hook #1369
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
Modernize import hook #1369
Changes from 17 commits
a321daa
279b535
f92e95b
afffc18
d821c0f
e469a8a
685b972
be81364
73958ed
e71a0ef
2af066d
bb490bf
31ea876
c02d5c6
970a189
059605b
ff170e9
63de923
624f7e3
bd7e745
46a85fe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -202,6 +202,14 @@ internal static IntPtr ToPython(object value, Type type) | |
| return ClassDerivedObject.ToPython(pyderived); | ||
| } | ||
|
|
||
| // ModuleObjects are created in a way that their wrapping them as | ||
| // a CLRObject fails, the ClassObject has no tpHandle. Return the | ||
| // pyHandle as is, do not convert. | ||
| if (value is ModuleObject modobj) | ||
| { | ||
| return modobj.pyHandle; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You need to return a new reference here.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @BadSingleton what about this one?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My bad missed that one. |
||
| } | ||
|
|
||
| // hmm - from Python, we almost never care what the declared | ||
| // type is. we'd rather have the object bound to the actual | ||
| // implementing class. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be directly on
BorrowedReference.Noneis a concept of the currently running runtime, andBorrowedReferencemight be a valid non-None reference from the previous runtime incarnation.